In December 2015, Juniper Networks disclosed that it had found unauthorized code in ScreenOS - the operating system running on its NetScreen VPN firewall appliances. The code had been there since at least 2012, possibly since 2008. It included two separate backdoors: one that could be used to log into any NetScreen device using a hardcoded administrative password, and one that was more subtle and more significant - a modification to the Dual EC DRBG random number generator that changed the generator's parameters. This second backdoor was designed to allow someone with knowledge of the changed parameters to decrypt VPN traffic that had been protected by that generator.
The investigation into the second backdoor led researchers to a remarkable conclusion. The Dual EC DRBG algorithm contained a known backdoor inserted by the NSA - a backdoor the NSA had advocated for being included in cryptographic standards. The Juniper backdoor appeared to have taken the NSA's algorithm, replaced the NSA's specific parameters with different parameters, and thereby created a backdoor accessible to the new attacker rather than to the NSA. In other words: someone had stolen and repurposed the NSA's backdoor. Intelligence agencies and researchers believe the most likely culprit is a foreign intelligence service - probably China or Russia. The mechanism existed because the NSA had compromised the cryptographic standards process. The downstream harm was caused by someone else using that compromise against the US government and its network infrastructure.
The Two Backdoors
Juniper described finding "two issues" in the December 2015 advisory. The first was a simple administrative password backdoor: ScreenOS would accept a specific hardcoded password to log in as an administrator. This is a crude but effective backdoor - anyone who knew the password could log into any NetScreen device globally. The password was eventually identified by security researchers: "<<< %s(un='%s') = %u". NetScreen devices were widely deployed by US government agencies, enterprise customers, and telecommunications providers.
The second backdoor was in the random number generator. ScreenOS used Dual EC DRBG (Dual Elliptic Curve Deterministic Random Bit Generator) as its cryptographic random number source. The NSA had advocated strongly for Dual EC DRBG's inclusion in the NIST SP 800-90A standard, and post-Snowden disclosure established that the NSA had inserted a backdoor: the algorithm includes two public elliptic curve points (P and Q) that the NSA had selected. If you know the discrete log relationship between P and Q (which only the selector of those points knows), you can predict all future outputs of the generator from observing a small amount of output. This allows passive decryption of VPN traffic protected by keys derived from that generator.
Juniper's ScreenOS was using Dual EC DRBG. Someone had modified the code to change the specific Q point used in the algorithm. The original Juniper code used a Q point that was not the standard NIST value (ScreenOS had already changed it, possibly intentionally). The backdoor replaced that Q point with yet another value. Whoever chose the replacement Q point knew the discrete log relationship - and therefore could decrypt all VPN traffic protected by keys generated after the modification. They had effectively created their own version of the NSA backdoor.
Attribution and the Cascade Effect
Attribution for the Juniper backdoor has never been formally established by US officials, but reporting from multiple sources has pointed to China as the most likely suspect for the Dual EC backdoor modification, with the NSA as the suspected source of the original administrative password backdoor. The sequence of events would be: NSA inserted or assisted in inserting the administrative password backdoor (or the capability was built to allow NSA access); a foreign intelligence service (likely China) subsequently discovered the Dual EC implementation in ScreenOS, recognized it as using the Dual EC DRBG approach, and inserted their own modified Q point.
The administrative backdoor password has never been formally attributed. Some researchers have noted that the format of the password string ("<<< %s(un='%s') = %u") looks like debugging code that might have been left in accidentally, while others note that it functions as a fully working administrative password and is unlikely to be accidental. Juniper stated it was unauthorized code.
The Juniper backdoor was present for approximately three to seven years before discovery. During that time, Juniper NetScreen devices were deployed by US government agencies, the Department of Defense, and US intelligence community contractors as well as by commercial enterprises. The potential scope of VPN traffic that could have been decrypted by whoever controlled the Dual EC backdoor is significant and not publicly quantified.