Even glass mason jars can pick up odours over time. Fortunately, you already have what you need to de-stink them right in your kitchen.
Instructables user peekaboo shows us that all it takes to de-stink a mason jar is a healthy pinch of salt and a little elbow grease. Rinse and dry the jar first so you get rid of any loose particles of food. Toss in a good sized pinch of salt, shake vigorously for about 30 seconds, and then wash and dry the jar as normal. I tried this method on a jar I stored homemade kimchi in for several months and had kept a slight odor despite a couple of good washings. The salt trick worked like a charm.
As an experiment, I also tried it on a plastic storage container we'd saved some Indian food in. While it worked well at getting the odor out, the salt did scratch up the inside a bit, leaving the plastic a little cloudy. I'd just stick to soaking those in vinegar and water.
How to de-stink glass jars [Instructables]