Repository navigation
node, node-lts: trust the system CA store by default (--openssl-use-def-ca-store) - #1133
Conversation
Configure with --openssl-use-def-ca-store, which defines NODE_OPENSSL_CERT_STORE and makes `--use-openssl-ca` the default (configure.py / src/node_options.h at v26.12.1 and v24.22.1). In that mode NewRootCertStore() loads OpenSSL's default paths INSTEAD of the compiled-in Mozilla roots, so a CA removed from ca-certificates (CVE-2026-111943, eMudhra) stops being trusted without a node rebuild. Our openssl uses --openssldir=/etc/ssl, so that is /etc/ssl/cert.pem and /etc/ssl/certs; ca-certificates becomes a runtime dep. Opt-out: --use-bundled-ca, on the command line or in NODE_OPTIONS. NODE_EXTRA_CA_CERTS still adds to either store. build.sh fails if the built node's --help does not mark the OpenSSL store as the default. New standalone test system_ca_store_default: a local server with a throwaway test CA named only by SSL_CERT_FILE must be trusted by default (stock node never reads SSL_CERT_FILE, so it fails there), and not with --use-bundled-ca / NODE_OPTIONS; plus NODE_EXTRA_CA_CERTS on top of the bundled store. Refs gominimal/pkgmgr-rs#1026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 25 minutes for your next included review. View limit details
Comment |
mitodrummer
left a comment
There was a problem hiding this comment.
--openssl-use-def-ca-store defines NODE_OPENSSL_CERT_STORE, and node's NewRootCertStore() then calls X509_STORE_set_default_paths() instead of adding the bundled roots, so the store is replaced rather than extended. The build fails if --help does not mark the OpenSSL store as default. The test shows a CA named only by SSL_CERT_FILE is trusted by default (stock node ignores SSL_CERT_FILE) and rejected under --use-bundled-ca, and it passes for node and node-lts on both arches. ca-certificates is declared at runtime, so every ca-certificates bundle update will now rebuild node, node-lts and everything that depends on them.
…A store, #1133) #1133 (node, node-lts: trust the system CA store by default) conflicted with this branch only in the import block of node{,-lts}/build.ncl: both sides added imports after `gcc`. Kept both: this branch's llvm, wasi-libc, llhttp-wasm-rebuild and amaro-wasm, and main's ca-certificates. Everything else auto-merged and is kept from both sides: - main's ca-certificates runtime dep, the --openssl-use-def-ca-store configure flag, the post-install `node --help` guard and the system_ca_store_default test; - this branch's wasm pins, splices, both censuses, smoke and type_strip. The CA change touches only configure flags and runtime deps, so neither census nor any splice is affected. No node, node-lts or next version moved on main since the last merge (fdb5524), so the undici / llhttp / amaro pins are unchanged. Checked: nickel format --check and bash -n on node{,-lts}; mip dump --packages evaluates on amd64 (651 packages) and arm64 (649), with ca-certificates and the wasm build deps both present on node and node-lts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t (review) The patched PREK_NATIVE_TLS default reads /etc/ssl/certs/ca-certificates.crt, so the store has to be in prek's closure, as #1130/#1133/#1134/#1135 do. Without it a session with prek and no store silently uses the compiled-in roots. ca-certificates leaves system_ca_default's test_deps (base and git do not bring it), so the test's `test -s` line now proves the runtime edge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of gominimal/pkgmgr-rs#1026 (prefer the system trust store; follow-up to CVE-2026-111943, eMudhra).
What
node and node-lts now trust the system CA store (
/etc/ssl, fromca-certificates) instead of the Mozilla roots compiled into node. A CA removed fromca-certificatesthen stops being trusted without a node rebuild../configure --openssl-use-def-ca-store. It definesNODE_OPENSSL_CERT_STORE, which makes--use-openssl-cathe default (configure.pyandsrc/node_options.hat v26.12.1 / v24.22.1). In that modeNewRootCertStore()(src/crypto/crypto_context.cc) callsX509_STORE_set_default_paths()in place of adding the bundled roots, so the store is replaced, not extended.--use-system-ca(andNODE_USE_SYSTEM_CA) would only add the system roots to the bundled ones, so a distrust would never take effect.--openssldir=/etc/ssl, so the default paths are/etc/ssl/cert.pem+/etc/ssl/certs, both shipped byca-certificates.ca-certificatesis now a runtime dep; without it node would trust nothing.build.shfails if the built node's--helpdoesn't mark the OpenSSL store as(default).Opt-out and semantics
--use-bundled-ca, on the command line or inNODE_OPTIONS(kAllowedInEnvvar), restores the compiled-in store.NODE_EXTRA_CA_CERTSstill adds to whichever store is in use.SSL_CERT_FILE/SSL_CERT_DIRoverride the default paths, as in OpenSSL.--use-system-cais accepted but does nothing in this mode.tls.rootCertificatesis still the bundled list, so the existingemsign_roots_removedtest still checks it.tls.getCACertificates('default')also still lists the bundled roots, becauselib/tls.jskeys that list on the--use-openssl-caflag rather than on the store actually in use. That only affects what the API reports; connections use the OpenSSL store.Test
system_ca_store_default(standalone, offline):SSL_CERT_FILE. Node must trust it by default. Stock node never readsSSL_CERT_FILE, so this fails without the flag (negative control).--use-bundled-ca, and again withNODE_OPTIONS=--use-bundled-ca, the same leaf must be rejected (UNABLE_TO_*).NODE_EXTRA_CA_CERTSmust still be honoured on top of the bundled store.🤖 Generated with Claude Code