Lego faces a conundrum when it comes to online advertising, according to Chief Marketing Officer Julia Goldin. That's because the toymaker's target audience is children, and the big internet companies aren't doing enough to protect them from unsafe content, she says.

"Platforms need to have more transparency and take more responsibility," Goldin said on Thursday in an onstage interview at the Cannes Lions International Festival of Creativity. "We also need to take more responsibility for how we work with platforms, both individually as brands but collectively as an industry."

Speaking at a session hosted by The Economist and featuring marketing leaders from Procter & Gamble and Taco Bell, Goldin addressed the increasing concern surrounding the safety of online content and the regulatory issues facing tech giants. Questions about how marketing executives are pressuring Facebook and Google to change their practices came up repeatedly at Cannes, the ad industry's most important annual awards event.

Goldin is focused on the safety of kids.

"Right now, they are on platforms where they are exposed to content that is actually damaging to them and their privacy is not protected," Goldin said. "I don't think we should accept that."

Goldin added that Lego doesn't advertise on the major sites when the company doesn't "feel that it's safe." When asked if the company promotes its products on YouTube, she said, Lego is "really focused on adults" on that site and is "very careful about where we actually will put advertising that's targeted to children."

YouTube did not provide CNBC with a response to Goldin's comments.