Skip to content

SECURITY: dotenvx: distrust emSign G3 (CVE-2026-111943) - #1116

Merged
bryan-minimal merged 2 commits into
mainfrom
security-dotenvx-node-lts
Oct 28, 2026
Merged

bryan-minimal merged 2 commits into
mainfrom
security-dotenvx-node-lts

Conversation

@bryan-minimal

Copy link
Copy Markdown
Member

Why

CVE-2026-111943 (eMudhra intermediate key compromise, Mozilla bug 2083449). The dotenvx release binary is a yao-pkg executable around Node v20.20.0. Its compiled-in root store still holds emSign ECC Root CA - G3.

This matters for dotenvx in particular. It talks HTTPS to its key service (dotenvx armor, dotenvx curl, and the background event worker) and sends bearer tokens. The truststore audit (pkgmgr-rs#1091, fleet run e75e32d0) lists it as shipped, and pkgmgr-rs#1017 tracks it.

Why not a wrapper

The planned fix was a wrapper that exports NODE_USE_SYSTEM_CA=1 or NODE_OPTIONS=--use-openssl-ca. Neither works here. Checked in a min box against the 2.38.2 binary:

  • NODE_OPTIONS is ignored. yao-pkg's node doesn't read it: process.execArgv stays empty, and the binary still connects to the emSign hosts with NODE_OPTIONS=--use-openssl-ca, with or without SSL_CERT_FILE.
  • NODE_USE_SYSTEM_CA can't remove the root. Node 20 doesn't have it. On node 22.15+ it only adds the system store to the bundled one, so the bundled root would still be trusted.
  • dotenvx doesn't pass NODE_OPTIONS to its worker anyway. The background worker that does the HTTP gets only an allowlisted environment (src/lib/events/workerEnvironment.js), and NODE_OPTIONS isn't on it.

An upstream bump wouldn't help either: a newer embedded node keeps its own bundled store unless it's rebuilt with the fixed roots.

What

  • dotenvx runs on node-lts 24.22.1. That version drops the emSign roots and blocks the 8 compromised keys (tls: reject chains containing blocked public keys nodejs/node#66871, #66877; node-lts has its own tests for both).
  • Built from upstream's sha256-pinned source release. npm ci --omit=dev --ignore-scripts uses upstream's package-lock.json. The 9 production deps are all pure JS, with no install scripts. It installs into the private prefix usr/libexec/dotenvx, with usr/bin/dotenvx a relative symlink to src/cli/dotenvx.js. This is the convention cf and mermaid-cli use.
  • This is upstream's supported npm distribution (npm i -g @dotenvx/dotenvx). The code branches on process.pkg for the binary-only paths.
  • One behaviour change: dotenvx update now prints the npm command. It no longer pipes https://dotenvx.sh into sh.
  • Runtime deps: coreutils (for /usr/bin/env) and subsetOf node-lts ["node"]. The arch match is gone, since there's one source for both arches.
  • New test trust_store_without_emsign. /bin/dotenvx must be a #!/usr/bin/env node script, so it can never be an embedded runtime again. And the default CA list of the node it runs on must have at least 100 certs and none of the 3 emSign roots NSS 3.131.1 removed. The fingerprints are the same as in node-lts's emsign_roots_removed test. The --version smoketest now checks the exact version.

Evidence

The TLS trust harness from #976 was extended with vendor rows. The dotenvx row runs the probe on the runtime the installed CLI really uses: the shebang interpreter for a script, or PKG_EXECPATH=PKG_INVOKE_NODEJS for the yao-pkg ELF. Live mode, 12 eMudhra hosts plus 2 positives, on arm64.

Before: pkgs main 44a31a3

client          | version                      | emSign      | AAA         | positive            | verdict
dotenvx         | 2.38.2 embedded              | 0F/6C/0?    | 6F/0C/0?    | OK,OK               | VULNERABLE
SELFTEST        | store minus anchors          | 6F/0C/0?    | 6F/0C/0?    | OK,OK               | FIXED
NEGCONTROL      | store plus anchors           | 0F/6C/0?    | 0F/6C/0?    | OK,OK               | VULNERABLE

After: this PR's head 534ae80

client          | version                      | emSign      | AAA         | positive            | verdict
dotenvx         | 2.38.2 on v24.22.1           | 6F/0C/0?    | 6F/0C/0?    | OK,OK               | FIXED
SELFTEST        | store minus anchors          | 6F/0C/0?    | 6F/0C/0?    | OK,OK               | FIXED
NEGCONTROL      | store plus anchors           | 0F/6C/0?    | 0F/6C/0?    | OK,OK               | VULNERABLE

Other checks:

  • min session (arm64): min package build --rebuild dotenvx, then min check. Everything passes, including the standalone tests (smoketest, run, trust_store_without_emsign).
  • Negative control: with ISRG Root X1 added to the test's "removed" list, the standalone tests read Fail. A fresh session was used for that run.

amd64 is covered only by the build-bot build. The harness here runs on arm64.

🤖 Generated with Claude Code

CVE-2026-111943)

The release binary embeds Node v20.20.0, whose compiled-in root store
still holds emSign ECC Root CA - G3. yao-pkg's node ignores NODE_OPTIONS
and Node 20 has no NODE_USE_SYSTEM_CA, so no wrapper can change its store.
Install upstream's source release with its package-lock (npm ci, prod deps,
all pure JS) and run it on node-lts 24.22.1, which drops the emSign roots
and blocks the 8 compromised keys. A new test checks the CLI runs on the
node runtime dep and that its default store holds none of the removed roots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner October 26, 2026 22:44
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 59 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 70 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 44a31a3 and b002a56.

Files selected for processing: 2
  • packages/dotenvx/build.ncl
  • packages/dotenvx/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@mitodrummer mitodrummer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the v2.38.2 source tarball sha256 (521cee25...) against GitHub. The lockfile's 9 production deps carry no install scripts, and src/cli/dotenvx.js is mode 0775 with a #!/usr/bin/env node shebang, so the symlinked entry point runs. The emSign fingerprints match node-lts's test and the layout follows the node-lts conventions in AGENTS.md; CI is green.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 29fca33 Oct 28, 2026
12 checks passed
@bryan-minimal
bryan-minimal deleted the security-dotenvx-node-lts branch October 28, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants