Democratic National Party Chairman Tom Perez speaks as about 300 people rally to protest against President Donald Trump's firing of Federal Bureau of Investigation Director James Comey outside the White House May 10, 2017 in Washington, DC.

The Democratic National Committee found a suspected attempt to hack into its voter database, a Democratic official confirmed to CNBC.

When the party discovered on Tuesday an apparent phishing campaign targeting its voter files, it notified law enforcement and took steps to boost security, the official said. Hackers did not gain entry to the party's system, VoteBuilder, or modify voter information, the person said.

CNN first reported that the DNC detected a hacking attempt and contacted the FBI about it.

"This attempt is further proof that there are constant threats as we head into midterm elections and we must remain vigilant in order to prevent future attacks," DNC Chief Security Officer Bob Lord said in a statement. "While it's clear that the actors were going after the party's most sensitive information — the voter file — the DNC was able to prevent a hack by working with the cyber ecosystem to identify it and take steps to stop it."

It is not clear who is responsible for the apparent hacking attempt. The FBI did not immediately respond to CNBC's request for comment.

The suspected attack comes at a time of high alert for political parties and campaigns ahead of November's midterm elections. The U.S. intelligence community has concluded that Russia carried out a campaign to influence the 2016 election — partly through attacks on the DNC and Hillary Clinton's campaign chairman, John Podesta.

Intelligence officials have warned that foreign actors could try again to affect this year's midterms, when Republicans and Democrats will fight for control of Congress. Cyberattack attempts have already apparently started.

Microsoft said Tuesday it detected hacking attempts targeting conservative political groups. Moscow denied the allegations.

Sen. Claire McCaskill, D-Mo., who is running in one of the year's most pivotal races, previously said Russians unsuccessfully tried to hack her Senate computer network.

The Democratic official told CNBC that Tuesday's attempt to break into the party's voter file involved a fake login page. The attacker tried to get usernames and passwords.

The person said a security firm and cloud service provider told the DNC about the attempt, and the party was able to stop it by suspending the attacker's account. Lord briefed state parties about the suspected attack on Wednesday morning.