#FakeNews is hurting more than political campaigns. Companies’ hard-earned reputations may be on the line when their ads pop up next to fake news stories and offensive YouTube videos.

Last year, major brands found their ads appearing in videos promoting extremist views and hate speech. JPMorgan Chase learned that it was advertising on a fake news site called Hillary 4 Prison. The ad ran under a headline claiming that actor Elijah Wood revealed “the horrifying truth about the Satanic liberal perverts who run Hollywood” (talk about bad publicity).

So how did these brands end up there? Programmatic advertising. Advertisers lay out general parameters of their target audience—say, young men under 25—and trust that data collection and automation will find that target person, no matter where on the internet they might be. It’s a cheap way to place ads on millions of websites that target specific groups of people based on their browsing habits. Yet if programmatic advertising lands airline ads on news stories about plane crashes and even puts money into the hands of cybercriminals, is getting views for cheap really worth it?

Some companies say no—refusing to risk their good name and valuable advertising dollars for ads placed next to questionable material in dark corners of the web. These companies have taken measures into their own hands by pulling down advertisements appearing next to unsightly content and integrating processes that ensure proper ad placement. For example, Chase began manually preapproving sites, a strategy known as whitelisting. The company went from advertising on 400,000 automated sites to 5,000 human-checked sites that it determined were reputable and likely to engage consumer interaction. Others have partnered with third-party ad verification vendors to run analytics and provide brand safety reports. As programmatic advertising gives companies less control over where their ads end up, companies need to find ways to mitigate the potential liabilities associated with misplaced ads.

For now, it looks like reputational harm is the biggest issue for companies whose ads appear next to offensive content. However, we can expect greater risks when ads run on websites that display copyright-infringing content or facilitate fraud, organized crime or even terrorism. Companies may be unintentionally adding legitimacy to crime by connecting themselves with all the risks of illegal websites, including viruses and malware. Do shareholders have a cause of action for mismanagement when a company fails to ensure safeguards are in place to prevent advertising that unintentionally tanks a company’s reputation and stock price or potentially funds criminals? We’ve yet to find out. In the meantime, it is a good idea for companies to vet their online advertising plans with compliance and legal teams, rather than rely solely on their advertisers or marketers to keep their ads on clean sites. In today’s Wild West of digital marketing platforms, where law enforcement and legislation are struggling to keep up, companies need to think about what their low-priced advertising reach is really costing them.