In a large pot or Dutch oven, heat the olive oil over medium heat. Add the chopped onion and cook until softened, about 5 minutes.
Add the minced garlic and cook for another minute until fragrant.
Add the uncooked spaghetti (broken in half if needed to fit), diced tomatoes (with their juice), vegetable broth, dried oregano, dried basil, salt, and black pepper to the pot. Stir to combine.
Bring the mixture to a boil, then reduce the heat to low, cover, and simmer for 15-20 minutes, or until the spaghetti is al dente and most of the liquid has been absorbed. Stir occasionally to prevent sticking.
Remove from heat and let stand, covered, for 5 minutes. Stir before serving.
Notes
Serve hot, garnished with fresh basil or grated Parmesan cheese if desired.