eMudhra CA issued trivially broken keys and system CA bundles still trust it
- YT :: https://www.youtube.com/watch?v=O905JwSgoi4
- Original title :: This Is Bad
ThePrimeagen explains a certificate authority incident. The Indian CA eMudhra generated eight NIST P-384 keys with a bug that made each private key the number four. Browsers revoked trust within a day, but system CA bundles used by curl, git, Python, Perl, Ruby, OpenSSL and Node have not been updated. Anyone holding a forged certificate can man-in-the-middle those tools, including curl-piped install scripts and npm installs. The video opens with a short sponsor read for Grok Bot.
HTTPS and certificate authorities in short
- Plain HTTP sends everything in the clear, so anyone on the path can read it.
- HTTPS encrypts the traffic so only the holder of the private key can decrypt it.
- Traffic passes through many intermediate servers. A malicious hop can pose as google.com, relay requests to the real site and read all data, including passwords. This is a man-in-the-middle attack.
- Certificate authorities (CAs) exist to prove that the server is the real google.com. Tools such as curl check a list of trusted CAs.
- If a trusted CA is compromised or broken, an attacker can get a certificate for any domain that the system will trust.
- There are only about 50 to 85 publicly trusted CAs.
The eMudhra incident
- eMudhra, a CA from India, had a key generation bug and held a key signing ceremony on 2025-04-30.
- Eight keys of the NIST P-384 elliptic curve type were generated, and all eight were broken.
- A P-384 private key should be a very large number. These keys had a private key equal to four (47 bytes of zeros followed by four).
- The flaw stayed unnoticed for over a year.
- Timeline on October 17: a researcher named Wayne ran a new key-checking tool over certificates disclosed in the CCADB and found the eight EC keys. By 6:00 the researcher emailed Apple, Chrome, Microsoft, Mozilla and eMudhra with proof. Chrome confirmed and shipped a fix almost immediately, eMudhra acknowledged the same day and most vendors updated within 24 hours.
Why it is still a problem
- Browsers update quickly. System CA bundles such as the cacert.pem file do not.
- That bundle is used by git, curl, Python 3, Perl, Ruby and OpenSSL. Tools that do not check revocation of the eMudhra certificates still trust them.
- Demo: a forged site is blocked by Chrome, but curl on the same machine reports a successful connection and returns the content.
- Consequences: a curl-piped bash install script may deliver different code than intended. An npm install on an outdated Node version could deliver malicious code, leading to stolen API keys and, for example, an account banned for distillation attacks.
- Side effect: the same flaw lets the owner man-in-the-middle their own devices, for example to root a smart home speaker.
Takeaways
- Update the OS, CA bundles and runtimes (Node and others) over the next weeks.
- Watch for CI systems being compromised and tokens being lost.
- The presenter finds it alarming that the internet trusted a key equal to four for over a year, and suspects it was abused somewhere.