Thanks to a recent revelation from Google, we now know that Facebook, Twitter and YouTube—three of the most prominent online platforms in the U.S.—sold political ads to the Russians ahead of the 2016 election.

Congress has long been concerned about foreign spending in our elections, which it sees as a national security issue: It banned such spending in the 1966 congressional amendments to the Foreign Agents Registration Act. But the law hasn’t kept up with technology, creating a loophole that allowed the Russians to purchase ads without detection in 2016.

The loophole exists because the Bipartisan Campaign Reform Act, which was passed in 2002, only refers to broadcast, cable, and satellite communications in its definition of “electioneering communications”—that is, political advertisements that attack or praise a candidate without explicitly urging the viewer to vote for or against her. BCRA required the purchaser of such advertisements on TV or radio to be disclosed, and amended the original Federal Election Campaign Act of 1974 to prohibit foreign nationals (and governments) from engaging in such political spending. But BCRA didn’t mention internet advertisements—which is unsurprising since they barely existed at the time.

The revelations about Russian ads online have fueled calls for Congress to revisit campaign finance law as it applies to the internet and make sure we find a way to prevent Russia, or any other foreign power, from spending on political ads in the United States again.

On Thursday, we took a step in the right direction. Minnesota Democratic Sen. Amy Klobuchar, and Republican Arizona Sen. John McCain, and Virginia Democratic Sen. Mark Warner have introduced the bipartisan Honest Ads Act. The bill creates a framework for updating campaign finance law for the 21st century, making a broader swath of online activity subject to transparency requirements and the ban on spending by foreign nationals.

The Honest Ads Act does this by expanding the definition of “electioneering communication” to include paid political advertisements online. It also requires major internet platforms to maintain a public database of all such communications purchased by a person or group if they spend more than $500. The company would include a digital copy, a description of the audience targeted, and the rate charged for each ad. Finally, the act requires online platforms to make all reasonable efforts to ensure that foreign citizens and powers are not purchasing political advertisements, just as radio and television broadcasters are already required to do.

Of course, the Honest Ads Act is not a silver bullet. The ad purchases on Facebook, Google, and Twitter were a brazen undertaking. The act would close off some avenues that the Russians used in 2016, but Moscow could in the future—and let’s not kid ourselves, may have in 2016—also purchase political ads through “dark money” groups. Thanks in part to Supreme Court decisions like Citizens United, these groups can take unlimited contributions from donors without having to disclose them.

The good news is that this problem, too, has a legislative solution. The DISCLOSE Act, versions of which have been introduced in Congress since 2010, would eliminate dark money as we know it. At its core, the legislation would require any group that spent above a threshold amount on elections to disclose its major donors of $10,000 or more.

Even without the passage of the DISCLOSE Act or similar legislation, the Honest Ads Act can play an important role in exposing and limiting the influence of Russian and other foreign election propaganda online. That is in large measure thanks to the work of nongovernmental organizations and the media, which have begun to expose how Russian political propaganda is influencing the political discourse in the United States.

To take one example, the Alliance for Securing Democracy, an initiative from the German Marshall Fund, recently debuted a web resource called Hamilton 68, which tracks the spread of Russian propaganda on Twitter based on a list of 600 accounts that have amplified Russian state messages in the past. If we were to combine that tool with the repository of political ads that the Honest Ads Act would create, we should be better able to see how messages being pushed by the Kremlin are making their way into political ads and which potential voters are seeing them.

Of course, whether the Honest Ads Act will pass is far from clear. A year ago, the bill would have zero chance of passage and would have been firmly opposed by the major social media platforms. Today, with growing public disgust at Russia’s ability to covertly purchase political ads, there just may be an opportunity to close a gaping loophole that should never have existed in the first place. The New York Timesreports that the “[t]ech Industry is mobilizing an army of lobbyists and lawyers … to help shape proposed regulations,” but the uniform opposition from the platforms themselves may have broken. Erin Egan, Facebook’s vice president for United States public policy, seemed to concede the possibility of a change in the law, telling the Times, “We look forward to continuing the conversation with lawmakers as we work toward a legislative solution” to “achieve transparency in political advertising.”

No doubt the odds of passing a new rule with teeth are long. But the bipartisan introduction of the bill, with the joint participation of McCain, is an encouraging sign. It was his leadership in the early 2000s that led to the passage of BCRA, the last major piece of campaign finance legislation passed by Congress.

As a relatively new medium for mass communication with few international boundaries, the internet (especially social media) presents unique challenges to the long-standing American interest in limiting the ability of unfriendly foreign governments to interfere with our elections. Ultimately, responding to this threat is going to take a multipronged effort involving both government and civil society, including the social media platforms and search engines themselves.

The passage of the Honest Ads Act would not make it impossible for the Russians or others to interfere in our next elections. But it would be a critical component of our effort to fight back by both eliminating opportunities for hidden foreign spending and providing American audiences with vital information on who’s trying to manipulate them. And having our leaders come together to strengthen our democracy’s defenses would send a powerful signal that we’re serious about addressing that threat.