Years could pass and it wouldn't grow mold.
Yep - mold is somewhat more tolerant, but high sugar content, mostly dry ingredients, and high trans-fat content = quite secure against microscopic baddies.
Now, can't say the same about larger bugs. The little annoying and hunger-killing things like flour bugs/beetles, ants, worms/larva all up in your food. Never much cared for those additives.
Something sweet and open to the environment is sort of like a bright light is to nearly everything that flies. No guarantee something will show up, especially when it's in a desk drawer or similar place where bugs are far less likely (as opposed to anywhere in a kitchen), but it's the more likely outcome as opposed to infectious/cellular assholes living off of an Oreo.