Put one’s foot in one’s mouth

To say something stupid, offensive or embarrassing and then regret it.

The professor put her foot in her mouth when she asked the overweight young lady if she was pregnant.