Malhar Ujawane

Notes

Note·

TIL: Node 20 still trusts the compromised eMudhra intermediates

Node 20.20.2's bundled roots still trust the compromised eMudhra CA. --use-openssl-ca helps until code passes ca: tls.rootCertificates.

The eMudhra incident page lists Node.js 22.23.4, 24.22.1 and 26.12.1 as patched against the eight compromised eMudhra intermediate CAs. Node 20 isn’t on the list, and it reached end of life on April 30, 2026. I wanted to see what that means in practice, so I tested it on a Debian 13 box.

The incident site runs test hosts whose certificates chain through one of the compromised intermediates (EM DV TLS CA - G3B, under the emSign ECC Root CA - G3 root). If a client connects, it trusts the compromised CA. I used the “noct” host, whose certificate was never logged to Certificate Transparency, because that’s the case non-browser clients can’t catch.

// tlscheck.js
const tls = require('tls');
const host = 'dv-g3b-noct-emudhra.we-have-a-problem.com';
function check(label, extra) {
  return new Promise(done => {
    const s = tls.connect({ host, port: 443, servername: host, ...extra }, () => {
      console.log(`${label}: authorized=${s.authorized}`); s.end(); done();
    });
    s.on('error', e => { console.log(`${label}: ${e.code}`); done(); });
  });
}
(async () => {
  await check('default trust store      ', {});
  await check('ca: tls.rootCertificates ', { ca: tls.rootCertificates });
})();

I ran it with the official Linux binaries from nodejs.org:

$ ./node-v20.20.2-linux-x64/bin/node tlscheck.js   # v20.20.2
default trust store      : authorized=true
ca: tls.rootCertificates : authorized=true
$ ./node-v22.23.4-linux-x64/bin/node tlscheck.js   # v22.23.4
default trust store      : CERT_REVOKED
ca: tls.rootCertificates : CERT_REVOKED

Node 20.20.2, the last 20.x release, completes the handshake. Node 22.23.4 rejects it as revoked. The reason is Node’s bundled root list, which you can check directly (this is 20.20.2):

$ node -p "const {X509Certificate}=require('crypto');require('tls').rootCertificates.map(c=>new X509Certificate(c).subject).filter(s=>/emSign ECC Root CA - G3/.test(s)).join('\n')"
C=IN
OU=emSign PKI
O=eMudhra Technologies Limited
CN=emSign ECC Root CA - G3

That prints the root on 20.20.2 and nothing on 22.23.4.

The trap I didn’t expect was --use-openssl-ca. It switches Node to the system store, and Debian’s ca-certificates 20250419+deb13u1 (listed as patched) no longer has that root:

$ node --use-openssl-ca tlscheck.js   # v20.20.2
default trust store      : UNABLE_TO_GET_ISSUER_CERT_LOCALLY
ca: tls.rootCertificates : authorized=true

The default connection now fails, but any code that passes ca: tls.rootCertificates still trusts the compromised CA, because that array is Node’s bundled list whatever flag you start with. That pattern is common because the Node TLS docs say a ca option completely replaces the default list, so code that adds a private CA spreads tls.rootCertificates into it first. Debian’s own nodejs 20.19.2 package behaved the same way on this box.

So the flag is a stopgap at best. Upgrade to 22.23.4, 24.22.1 or 26.12.1 or later, which are also the Brotli fix releases, and grep for rootCertificates in your code and dependencies.

Get new posts in your inbox

© 2026 Malhar Ujawane. Built with Astro.