Jennifer Newstead knew she faced a formidable task when she took over as chief legal officer of Meta Platforms four years ago.

The social media giant’s reputation was in tatters following a data-leak scandal that enabled consulting firm Cambridge Analytica to harvest private information from 50 million Facebook users without their permission, a blunder that led to a $5 billion Federal Trade Commission fine.