13ms to scan every eMudhra CA private key
Scanning every possible eMudhra private key took me 13 milliseconds. All eight compromised intermediate CA keys were integers below 256 — 4, 56, 66, 115, 155, 156, 230, and 237 — on a curve where the private key is suppo
Scanning every possible eMudhra private key took me 13 milliseconds. All eight compromised intermediate CA keys were integers below 256 — 4, 56, 66, 115, 155, 156, 230, and 237 — on a curve where the private key is supposed to be a roughly 384-bit random number.
That is not a weakened key. That is a key with the security removed and the label left on.
What happened, briefly
In October 2026 it became public that eight eMudhra intermediate certificates — six for TLS issuance, two for code signing, some cross-signed by Sectigo — had P-384 private keys small enough to fit in one byte. Mozilla got the report on October 17 at 20:06 UTC; Firefox and Chrome blocked the intermediates the same day, eMudhra revoked them on the 18th, Apple followed on the 19th, Microsoft on the 20th. The weak keys dated back to an April 30, 2025 key ceremony, so they were recoverable from the public certificates for about 17 months.
Hanno Böck's post this week is the interesting part: his badkeys scanner almost caught this. A November 2025 issue proposed checking for small elliptic-curve private keys. He wrote a preliminary script generating keys for values up to 16 — which means d=4 was literally sitting on his laptop — but never added them to the blocklist while he looked for a more elegant algorithmic check. The keys were eventually found by someone running Google's paranoid_crypto, which does implement that check (baby-step giant-step), against the CCADB certificate database.
I measured how trivial the recovery is
An EC public key is Q = d·G. If d is small, you don't need baby-step giant-step. You just add G to itself and compare. One point addition per candidate:
import time
p = 2**384 - 2**128 - 2**96 + 2**32 - 1 # P-384 field prime
a = p - 3
Gx = int("aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", 16)
Gy = int("3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", 16)
def add(P, Q):
if P is None: return Q
if Q is None: return P
x1, y1 = P; x2, y2 = Q
if x1 == x2 and (y1 + y2) % p == 0: return None
m = ((3*x1*x1 + a) * pow(2*y1, -1, p) if P == Q
else (y2 - y1) * pow(x2 - x1, -1, p)) % p
x3 = (m*m - x1 - x2) % p
return (x3, (m*(x1 - x3) - y1) % p)
targets = {4, 56, 66, 115, 155, 156, 230, 237}
t0 = time.perf_counter(); Q = None; found = []
for d in range(1, 256):
Q = add(Q, (Gx, Gy)) # Q is now d·G
if d in targets: found.append(d)
print(f"{(time.perf_counter()-t0)*1000:.1f} ms", found)
scan d=1..255: 13.4 ms, 19,035 candidates/sec
recovered set: [4, 56, 66, 115, 155, 156, 230, 237]
naive scan reach: 1s -> d<=16,134 (~14 bits), 1day -> d<=1,393,944,176 (~31 bits)
Pure Python, no libraries, no optimization, on a shared VM. The whole search space is 255 candidates. In entropy terms the strongest of the eight keys, 237, is an 8-bit secret; d=4 is 3 bits. A proper P-384 key has about 376 more bits of search space than the entire range these keys lived in.
To be precise about what I did: I reproduced the recovery method and timed it against the published key values. I did not re-derive them from the original certificates — those are revoked and the values are already public from multiple incident reports.
The check that would have caught it costs nothing
This is the part that should bother people. Böck's preliminary script covered d up to 16, which catches exactly 1 of the 8 keys. Extending it to all 255 one-byte values is not a research project; it's the 13 ms above, precomputed once per curve and shipped as a blocklist. He has since added exactly that to badkeys.
The failure mode is worth naming because it is not cryptographic. Nobody broke P-384. A ceremony script produced a weak key set alongside the real one, the labels looked alike, and several people across several steps didn't notice. Then the ecosystem's safety net — scanners that check public keys for known-bad patterns — had a hole exactly the shape of this bug, because the elegant version of the check (Pollard's kangaroo, baby-step giant-step) was more interesting than the dumb version (a list of 255 hashes).
There is a general lesson here for anyone building validation: ship the dumb check first. A blocklist of small-d keys is embarrassing code. It is also 13 milliseconds of compute standing between "17 months of forgeable CA keys" and "caught by a cronjob." Elegance can come in the second commit.
Sources: Hanno Böck, "How I almost found the eMudhra d=4 Private Key", incident timeline and key values.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.