I have some walnuts I found in the back of my cabinet that are probably 5 years old. The packaging says best if used by 2010. I tasted them and they taste alright, maybe a little tartish but I don't mind. I was wondering if walnuts and other nuts actually ever go bad considering that they are dry.
Yes, nuts are very fatty, and they will eventually go rancid— if this is the case, they will taste very poor. They can also dry out, or in more rare cases (especially if stored improperly) be infested with insects or molds.
Generally, they should be good for six months to a year at their best flavor, depending on the variety (in the shell).
Five years is a little long. I am not sure I would want to eat nuts that old.
Beyond obvious downsides like a rancid taste or textural deterioration, both tree nuts and peanuts are in a category of foods particularly prone to molds that produce aflatoxin, which can cause liver failure or liver damage in sufficient quantities.
When I was importing a product from Asia that contained peanuts, it was one of the things that was considered a substantial risk, as it's a fairly common reason to initiate a recall if tests prove aflatoxin present in sufficient quantities to warrant concern. Certainly these molds are more prone to develop after extended long term storage, as mold growth is more likely over time.