Cavities can produce a bad odor or breath that smells sour or rotten due to the buildup of bacteria in the decayed area.