The Senate Judiciary Committee on Thursday passed legislation that would ban foreign nationals who try to interfere with U.S. elections.

The Defending Elections against Trolls from Enemy Regimes, or the DETER Act, is aimed at cracking down on people outside the U.S. who try to change the outcome of elections, an issue members of both parties have raised as a priority this year. Under the bill, which passed in a unanimous voice vote, foreigners who are deemed to have meddled in a U.S. election couldn't get a U.S. entry visa.

The bill targets "improper interference," which is defined as conduct that violates federal criminal, voting rights, or campaign finance law, or is under the direction of a foreign government. Sens. Dick Durbin, D-Ill., and Lindsey Graham, R-S.C., sponsored the DETER Act.

“In 2016, Russia committed an act of cyberwar against our country, and Congress has a responsibility to take immediate action to prevent Russia’s efforts to influence and disrupt the 2018 elections. The bipartisan DETER Act would prohibit foreigners who improperly interfere in our elections from coming to the United States to further their schemes, and bar them from entering our country in the future,” Durbin said in a statement in April.

[Related: Top US officials warn of 'pervasive' Russian meddling in midterm elections, 2020 cycle]

Graham, the bill’s lone cosponsor, also cited Russia’s influence in the 2016 presidential election as why the legislation was necessary.

The passage of the DETER Act out of the Senate Judiciary Committee and to the full Senate floor comes with less than a month until the November midterms.

Still, there is no immediate guarantee Senate Majority Leader Mitch McConnell will call it up on the Senate floor before the midterm elections in November.

Last month, Trump signed an executive order authorizing sanctions against foreigners who seek to meddle in U.S. elections.

"This is intended to be a very broad effort to prevent foreign manipulation of the political process," national security adviser John Bolton told reporters on a conference call.

The executive order allows sanctions without congressional action against foreign nations, organizations, and individuals seeking to influence elections. Despite that move, Trump has drawn criticism for not taking threats to the U.S. electoral system seriously enough, especially Russia’s 2016 actions.