It smells like that because it's been contaminated from oils from your fingers / face and from dirty sponges. Also where you stored it will contribute to the degradation of it, for example if you store it in a hot, humid environment like a bathroom or on a vanity that gets sun exposure.
The actual odour you're smelling is the fecal matter from the over-population of the bacteria that's building up.
Also, the foundation is 6-7 months old, (depending on use / storage) it's past it's prime.
Stop using it and throw it away!
To make liquid foundations last longer, never use it directly from the bottle, just decant a small amount onto a metal palette and use from there. Always cap immediately, and store the bottle in a cool, dark place. (Room temp. is ok).
Always remember to shake all liquid foundations before use!