Shelf life of spices
Dried herbs really do only last around six months, certainly no longer than a year. They're generally easy to get in small quantities, though.

Spices are trickier. They'll generally last rather longer, but the time will vary. If the spice is used for the colour and/or heat (e.g. turmeric, chilli) it will generally last much, much longer than one used for its smell and/or taste. Whole spices last much, much longer than pre-ground; I generally buy whole spices from asian stores, they sell them in much larger amounts for the same prices as supermarkets; and use a coffee mill to grind the right amount just before cooking (and keep a separate one for coffee!).

If kept in the dark, in a dry, clean, airtight glass container, spices and dried herbs will certainly not become health hazards, and should not pick up unpleasant tastes or odours. The strong-tasting / strong-smelling ones will, however, lose taste and smell, eventually almost completely; since that is the whole point of using them, you might as well not bother once they're off.