Word for awkward situation
Solution 1:
David put his foot in his mouth.
foot in one's mouth, put one's: Say something foolish, embarrassing, or tactless. For example, Jane put her foot in her mouth when she called him by her first husband's name. (http://www.dictionary.com/browse/foot-in-one-s-mouth--put-one-s)
The mistake itself could be called a blooper. If you want something more old-fashioned: an indiscretion.
If David wants to express regret for what he said, he could say, "Me and my big mouth."
Solution 2:
Awkward IS the word.
"David says to Jane: "Wow, that John is a really boring guy to hang out with."
(...at that moment, John walks into the room, accidentally hearing the conversation between David and Jane.)"
Jane looks at David and whispers - Awkward !
Solution 3:
shoot off (one's) mouth/face
Slang- To speak indiscreetly.
-
To brag; boast.
-- Freedictionary
"The whole damned bunch will fall apart ; all because you have to go and shoot your mouth off — you cock-eyed, mush-faced, cake-eating son of a so- and-so !"
-- Hollywood Holiday: An Extravagant Comedy, Benn Wolfe Levy, John Van Druten, 1931
faux pas
noun [ C ] US /ˈfoʊ ˈpɑ/ plural faux pas /ˈfoʊ ˈpɑ, ˈpɑz/
a remark or action in a social situation that is a mistake and causes embarrassment or offense:She made the faux pas of referring to Wales as “part of England.”
-- Cambridge Dictionary