The headquarters of Juniper Networks in Sunnyvale, California, on January 1, 2014.
Kris Tripplaar/Sipa USA via AP Images
The headquarters of Juniper Networks in Sunnyvale, California, on January 1, 2014.
Now playing
01:40
Newly discovered hack has U.S. government worried
5 ways us can stop hackers orig nws_00010722.jpg
5 ways us can stop hackers orig nws_00010722.jpg
Now playing
01:37
5 ways the US can stop hackers
Now playing
04:21
GPS spoofing: Russia's new cyberweapon?
russia DNC hacking RON 2_00000808.jpg
russia DNC hacking RON 2_00000808.jpg
Now playing
02:30
US blames Russia for power grid cyberattacks
Photo of North Korean leader Kim Jong Un taken from the front page of the state paper Rodong Sinmun on Friday September 22.
Rodong Sinmun/KCNA
Photo of North Korean leader Kim Jong Un taken from the front page of the state paper Rodong Sinmun on Friday September 22.
Now playing
02:28
US blames North Korea for cyberattack
The Kremlin wall and towers dominate the skyline at the Red Square in Moscow, on March 2, 2012. Russia on March 4 votes in presidential elections expected to send Vladimir Putin back to the Kremlin after his four year stint as prime minister.  AFP PHOTO / SERGEI SUPINSKY        (Photo credit should read SERGEI SUPINSKY/AFP/Getty Images)
SERGEI SUPINSKY/AFP/AFP/Getty Images
The Kremlin wall and towers dominate the skyline at the Red Square in Moscow, on March 2, 2012. Russia on March 4 votes in presidential elections expected to send Vladimir Putin back to the Kremlin after his four year stint as prime minister. AFP PHOTO / SERGEI SUPINSKY (Photo credit should read SERGEI SUPINSKY/AFP/Getty Images)
Now playing
03:34
NYT: US spies paid Russian who promised cyberweapons, Trump intel
BERLIN, GERMANY - DECEMBER 28: A participant sits with a laptop computer as he attends the annual Chaos Communication Congress of the Chaos Computer Club at the Berlin Congress Center on December 28, 2010 in Berlin, Germany. The Chaos Computer Club is Europe's biggest network of computer hackers and its annual congress draws up to 3,000 participants. (Photo by Sean Gallup/Getty Images)
Sean Gallup/Getty Images
BERLIN, GERMANY - DECEMBER 28: A participant sits with a laptop computer as he attends the annual Chaos Communication Congress of the Chaos Computer Club at the Berlin Congress Center on December 28, 2010 in Berlin, Germany. The Chaos Computer Club is Europe's biggest network of computer hackers and its annual congress draws up to 3,000 participants. (Photo by Sean Gallup/Getty Images)
Now playing
01:47
NYT: NSA hack bigger than Snowden
A roll of "I Voted" stickers, which are handed out to residents after they vote, sit on an election officials table at a polling place on November 4, 2014 in Ferguson, Missouri.  In last Aprils election only 1,484 of Ferguson's 12,096 registered voters cast ballots. Community leaders are hoping for a much higher turnout for this election. Following riots sparked by the August 9 shooting death of Michael Brown by Darren Wilson, a Ferguson police officer, residents of this majority black community on the outskirts of St. Louis have been forced to re-examine race relations in the region and take a more active role in the region's politics. Two-thirds of Fergusons population is African American yet five of its six city council members are white, as is its mayor, six of seven school board members and 50 of its 53 police officers.  (Photo by Scott Olson/Getty Images)
Scott Olson/Getty Images
A roll of "I Voted" stickers, which are handed out to residents after they vote, sit on an election officials table at a polling place on November 4, 2014 in Ferguson, Missouri. In last Aprils election only 1,484 of Ferguson's 12,096 registered voters cast ballots. Community leaders are hoping for a much higher turnout for this election. Following riots sparked by the August 9 shooting death of Michael Brown by Darren Wilson, a Ferguson police officer, residents of this majority black community on the outskirts of St. Louis have been forced to re-examine race relations in the region and take a more active role in the region's politics. Two-thirds of Fergusons population is African American yet five of its six city council members are white, as is its mayor, six of seven school board members and 50 of its 53 police officers. (Photo by Scott Olson/Getty Images)
Now playing
03:15
Homeland Security Chief: Hackers targeting voting systems
CNN/File
Now playing
02:17
Source ties Russia to Wikileaks emails
Reuters
Now playing
02:21
Putin ally warns of 'war' if US elects Hillary Clinton
Getty Images
Now playing
02:30
Hackers playing US for entertainment?
Russian President Vladimir Putin visits a polling station during parliamentary elections in Moscow on September 18, 2016. / AFP / POOL / GRIGORY DUKOR        (Photo credit should read GRIGORY DUKOR/AFP/Getty Images)
AFP/AFP/AFP/Getty Images
Russian President Vladimir Putin visits a polling station during parliamentary elections in Moscow on September 18, 2016. / AFP / POOL / GRIGORY DUKOR (Photo credit should read GRIGORY DUKOR/AFP/Getty Images)
Now playing
02:15
Is hacking group tied to Russian intelligence?
A man walks to use a voting booth March 1, 2016, at one of the Virginia primary election polling stations at Colin Powell Elementary School, in Centreville, Virginia.
Voters in a dozen states will take part in "Super Tuesday" -- a series of primaries and caucuses in states ranging from Alaska to Virginia, with Virginia the first to open its polling stations at 6:00 am (1100 GMT).  / AFP / PAUL J. RICHARDS        (Photo credit should read PAUL J. RICHARDS/AFP/Getty Images)
PAUL J. RICHARDS/AFP/Getty Images
A man walks to use a voting booth March 1, 2016, at one of the Virginia primary election polling stations at Colin Powell Elementary School, in Centreville, Virginia. Voters in a dozen states will take part in "Super Tuesday" -- a series of primaries and caucuses in states ranging from Alaska to Virginia, with Virginia the first to open its polling stations at 6:00 am (1100 GMT). / AFP / PAUL J. RICHARDS (Photo credit should read PAUL J. RICHARDS/AFP/Getty Images)
Now playing
01:52
US officially blames Russia for political hacks
FBI Director James Comey (R) speaks as Assistant Attorney General for National Security John Carlin (L) listens during a news conference for announcing a law enforcement action March 24, 2016 in Washington, DC.
Alex Wong/Getty Images
FBI Director James Comey (R) speaks as Assistant Attorney General for National Security John Carlin (L) listens during a news conference for announcing a law enforcement action March 24, 2016 in Washington, DC.
Now playing
04:31
Assistant attorney general to hackers: We'll find you
Hillary Clinton and Donald Trump shake hands following the first presidential debate moderated by NBC host Lester Holt(bottom L) at Hofstra University in Hempstead, New York on September 26, 2016.
PAUL J. RICHARDS/AFP/Getty Images
Hillary Clinton and Donald Trump shake hands following the first presidential debate moderated by NBC host Lester Holt(bottom L) at Hofstra University in Hempstead, New York on September 26, 2016.
Now playing
01:27
Fact check: Was Russia behind the DNC cyberattacks?
WESTBURY, NY - SEPTEMBER 26:  Democratic presidential nominee Hillary Clinton speaks during a debate-watch party at The Space at Westbury on September 26, 2016 in Westbury, New York. Tonight was the first of four debates for the 2016 election - three presidential and one vice presidential.  (Photo by Justin Sullivan/Getty Images)
Justin Sullivan/Getty Images North America/Getty Images
WESTBURY, NY - SEPTEMBER 26: Democratic presidential nominee Hillary Clinton speaks during a debate-watch party at The Space at Westbury on September 26, 2016 in Westbury, New York. Tonight was the first of four debates for the 2016 election - three presidential and one vice presidential. (Photo by Justin Sullivan/Getty Images)
Now playing
01:50
Clinton's Wall Street speeches leaked?

Story highlights

The FBI is investigating the breach, which involved hackers installing a back door on computer equipment

The breach is believed to be the work of a foreign government, U.S. officials said, because of the sophistication involved

Washington CNN —  

A major breach at computer network company Juniper Networks has U.S. officials worried that hackers working for a foreign government were able to spy on the encrypted communications of the U.S. government and private companies for the past three years.

The FBI is investigating the breach, which involved hackers installing a back door on computer equipment, U.S. officials told CNN. Juniper disclosed the issue Thursday along with an emergency security patch that it urged customers to use to update their systems “with the highest priority.”

The concern, U.S. officials said, is that sophisticated hackers who compromised the equipment could use their access to get into any company or government agency that used it.

One U.S. official described it as akin to “stealing a master key to get into any government building.”

The breach is believed to be the work of a foreign government, U.S. officials said, because of the sophistication involved. The U.S. officials said they are certain U.S. spy agencies themselves aren’t behind the back door. China and Russia are among the top suspected governments, though officials cautioned the investigation hasn’t reached conclusions.

It’s not yet clear what if any classified information could be affected, but U.S. officials said the Juniper Networks equipment is so widely used that it may take some time to determine what damage was done.

Chinese cyber espionage group caught hacking defense, industrial base

A senior administration official told CNN, “We are aware of the vulnerabilities recently announced by Juniper. The Department of Homeland Security has been and remains in close touch with the company. The administration remains committed to enhancing our national cybersecurity by raising our cyber defenses, disrupting adversary activity, and effectively responding to incidents when they occur.”

Juniper Networks’ security fix is intended to seal a back door that hackers created in order to remotely log into commonly used VPN networks to spy on communications that were supposed to be among the most secure.

Juniper said that someone managed to get into its systems and write “unauthorized code” that “could allow a knowledgeable attacker to gain administrative access.”

Such access would allow the hacker to monitor encrypted traffic on the computer network and decrypt communications.

Hacker who allegedly passed U.S. military data to ISIS arrested

Juniper sells computer network equipment and routers to big companies and to U.S. government clients such as the Defense Department, Justice Department, FBI and Treasury Department. On its website, the company boasts of providing networks that “US intelligence agencies require.”

Its routers and network equipment are widely used by corporations, including for secure communications. Homeland Security officials are now trying to determine how many such systems are in use for U.S. government networks.

Juniper said in its security alert that it wasn’t aware of any “malicious exploitation of these vulnerabilities.” However, the alert also said that attackers would leave behind no trace of their activity by removing security logs that would show a breach.

“Note that a skilled attacker would likely remove these entries from the log file, thus effectively eliminating any reliable signature that the device had been compromised,” the Juniper security alert said. If encrypted communications were being monitored, “There is no way to detect that this vulnerability was exploited,” according to the Juniper security alert.

According to a Juniper Networks spokeswoman’s statement, “Once we identified these vulnerabilities, we launched an investigation and worked to develop and issue patched releases for the impacted devices. We also reached out to affected customers, strongly recommending that they update their systems.”

Obama nominates new OPM director after hack

U.S. officials said it’s not clear how the Juniper source code was altered, whether from an outside attack or someone inside.

The work to alter millions of lines of source code is sophisticated. The system was compromised for three years before Juniper uncovered it in a routine review in recent weeks.

Juniper said it was also issuing a security fix for a separate bug that could allow a hacker to launch denial-of-service attacks on networks.

CNN’s Wesley Bruer contributed to this report.