Skip to content

fix(deps): build on node 22.23.4 to reject the compromised eMudhra intermediates - #5707

Merged
fracasula merged 5 commits into
developfrom
fix/node-22.23.4-emudhra-intermediates
Oct 21, 2026
Merged

fracasula merged 5 commits into
developfrom
fix/node-22.23.4-emudhra-intermediates

Conversation

@fracasula

@fracasula fracasula commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Moves both images to Node 22.23.4, the first 22.x release that rejects certificates issued under the eMudhra intermediates whose private keys were compromised (https://emudhra.we-have-a-problem.com/).

  • .nvmrc - 22.22.3 to 22.23.4, so CI runs on the patched release.
  • Dockerfile - node:22.22.3-alpine3.22 to node:22.23.4-alpine3.24. The official image publishes 22.23.x only on alpine3.23 and alpine3.24, so the Alpine version has to move too; 3.24 is the one that stays supported longest.
  • Dockerfile-ut-func - Node now comes from the official node:22.23.4-bookworm-slim image (COPY --from of node, its headers and node_modules, plus the npm, npx and corepack links) instead of NodeSource's setup_22.x. NodeSource still serves 22.23.3, and setup_22.x installs whatever it has, so the UT image could not be pinned to a patched release that way. The version is now the pinned tag, the same release the main image runs, and Dependabot keeps it current. python3 is installed explicitly because node-gyp needs it and the NodeSource package used to pull it in.
  • Dockerfile-ut-func (review suggestions) - ubuntu:22.04 is pinned by index digest, and the first RUN adds apt-get upgrade -y and an explicit ca-certificates, so the system bundle that curl reads carries the Ubuntu fix too.

The main image (destination transformations) moves too, because both images and CI share .nvmrc.

What is the related Linear task?

Part of https://linear.app/rudderstack/issue/SEC-607

Please explain the objectives of your changes below

fetch and fetchV2 in user transformations go through node-fetch on an https.Agent with no ca option (src/util/ivmFactory.js, src/util/utils.js). Nothing sets --use-openssl-ca, --use-system-ca or NODE_EXTRA_CA_CERTS: not this repo, not rudderstack-operator, not rudder-devops, where NODE_OPTIONS is only --no-node-snapshot. Node's bundled root store therefore decides what is trusted, and a patched system ca-certificates does not help.

How this was verified:

  • Official Node binaries against the advisory's twelve *-emudhra.we-have-a-problem.com test hosts, using https.get with the default CA store. 22.22.3 (what ships today) and 22.23.3 both trust the six emSign-chained hosts. 22.23.4 rejects all twelve with CERT_REVOKED.
  • The Alpine 3.24 move, using node:22.23.3-alpine3.24 as a stand-in until 22.23.4 is published: the production target builds (including isolated-vm), /health is up, and a /transformation/test run with fetchV2 works. That run also trusted dv-g3b-emudhra.we-have-a-problem.com while the image had ca-certificates-bundle-20261020-r0 installed, which confirms the system store is not on this path. Apart from NODE_VERSION, the image config (Env, Entrypoint, Cmd, WorkingDir) of the old and stand-in bases is identical.
  • The UT image with Node copied from the official image, using node:22.23.3-bookworm-slim as a stand-in: the production target builds, with isolated-vm 6.2.0 compiled from source through node-gyp and python3. node, npm, npx and corepack resolve from /usr/local/bin for the node user, ca-certificates is 20260816ubuntu0.22.04.1, /health is up, and a /transformation/test run with fetchV2 works.
  • The final images on the pinned 22.23.4 bases (built locally on arm64): both run Node v22.23.4, and a /transformation/test run with fetchV2 in each gets 200 from https://example.com/ and CERT_REVOKED from https://dv-g3b-emudhra.we-have-a-problem.com/. The arm64 manifests in both pinned indexes are the same images that rejected all twelve test hosts.
  • Not run locally: the unit and component suites. CI runs them on 22.23.4 through .nvmrc.

Both bases are pinned by index digest. When Docker Hub adds the remaining architectures to these tags, the tags move to new indexes and Dependabot will offer the new digests; the pinned indexes already carry linux/amd64 and linux/arm64.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

Node 22.23.x also ships Mozilla's earlier root removals: the bundled store drops from 145 to 116 roots between 22.22.3 and 22.23.4, including DigiCert Global Root CA, DigiCert Assured ID Root CA and GTS Root R2. A transformation that calls an endpoint whose chain still ends only at one of those roots will start failing TLS. The matching rudder-pytransformer change (https://github.com/rudderlabs/rudder-pytransformer/pull/145) drops the same roots through certifi, so JS and Python transformations keep trusting the same set.

In the UT image, node, npm and npx move from /usr/bin to /usr/local/bin, which comes first on the default PATH.

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

Alpine 3.22 to 3.24 changes the musl and g++ toolchain that builds isolated-vm; the stand-in build above covers it on arm64 only.


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

…termediates

User transformations call out through node-fetch with Node's bundled CA store, which up to 22.23.3 trusts certificates
issued under the eMudhra intermediates whose private keys were compromised. 22.23.4 rejects them.

The official image ships 22.23.x only on alpine3.23 and alpine3.24, so the base moves to alpine3.24. Its digest is
left as a RESOLVE marker until the tag is published. The UT image installs Node from NodeSource's setup_22.x, so its
build now fails when that installs anything older than 22.23.4.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9bfc44d9-6ae3-458e-8c50-1c8019ee32cd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.29%. Comparing base (cae58e7) to head (108a169).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5707   +/-   ##
========================================
  Coverage    92.29%   92.29%           
========================================
  Files          731      731           
  Lines        40633    40633           
  Branches      9441     9440    -1     
========================================
  Hits         37501    37501           
  Misses        2948     2948           
  Partials       184      184           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lvrach

lvrach commented Oct 21, 2026

Copy link
Copy Markdown
Member

Looks right from the eMudhra side. Two optional suggestions, nothing blocking.

[nit] Dockerfile-ut-func

  • Pin the base by index digest: ubuntu:22.04@sha256:0a9887931b0e38af2e3487ed39e29436b0535c4f3f52e57745baaf79d1898956. Resolved today; it lists amd64 and arm64.
  • Add DEBIAN_FRONTEND=noninteractive apt-get upgrade -y and ca-certificates to the first RUN. The OS bundle then gets the Ubuntu fix too, for anything in the image that reads the system store, like curl.

What I checked

  • Your branch at 71a90b0 on a Mac mini, with node:22.23.3-alpine3.24 standing in for the unpublished 22.23.4 tag. The main production image builds.
  • The ut- build stops at your guard with nodejs v22.23.3 is older than 22.23.4. The guard works.
  • The same .nvmrc/Dockerfile change on Node 22.23.4: 131 TS and 101 JS suites pass, 0 fail.
  • isolated-vm 6.2.0 builds from source and runs on Alpine 3.24 (g++ 15.2, Python 3.14). The Alpine jump is fine.
  • The official 22.23.4 binary rejects both test hosts with CERT_REVOKED. 22.22.3 gets HTTP 200 from them.

node:22.23.4-alpine3.24 still has an empty index (no platforms) as of 15:00 CEST. I'm watching it and will post here when it lands.

Pins ubuntu:22.04 by its index digest, and runs apt-get upgrade with an explicit ca-certificates in the first RUN, so
the system bundle that curl and other tools read carries the Ubuntu eMudhra fix too.
NodeSource's setup_22.x installs whatever 22.x NodeSource has, which is still 22.23.3, so the UT image could not be
pinned to the patched 22.23.4. Node now comes from node:22.23.4-bookworm-slim, the same release the main image runs,
and Dependabot keeps the pin current. Its digest is a RESOLVE marker until the tag lists amd64 and arm64.

python3 is installed explicitly for node-gyp; the NodeSource package used to pull it in. The version guard goes,
since the pinned tag now sets the version.
@ItsSudip

Copy link
Copy Markdown
Member

Reviewed from the DT side (main Dockerfile), the approach looks good to me. Holding approval only on the build:

  • Both image builds are currently failing (Build Transformer Docker Image - PR amd64 and Build User Transformer Docker Image - PR arm64), since the node:22.23.4 tags still point at an empty index.
  • Once node:22.23.4-alpine3.24 and node:22.23.4-bookworm-slim list both linux/amd64 and linux/arm64, please pin both FROM lines as tag@sha256:<index digest> (the DT image was digest-pinned before this change, so it shouldn't go out unpinned) and remove the two # RESOLVE: lines.
  • I'd like to see the amd64 DT build green in CI before merging, since the Alpine 3.22 → 3.24 isolated-vm build was only verified on arm64 so far.

Ping me once it's undrafted and green, and I'll approve.

Post-deploy, I'll verify from a DT pod that https://dv-g3b-emudhra.we-have-a-problem.com/ fails TLS, and watch destination delivery/proxy errors for TLS failures caused by the dropped roots (DigiCert Global Root CA, GTS Root R2, etc.).

@lvrach lvrach 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.

Reviewed for the eMudhra fix. No functional issues. I'm holding approval only on the upstream images, like Sudip.

Checked

  • amd64: isolated-vm 6.2.0 builds from source and runs on node:22.23.3-alpine3.24 under amd64 emulation. With your arm64 run, both arches of the Alpine 3.24 move are covered.
  • Node copied into jammy: the official v22.23.4 binary needs glibc ≤ 2.28 and GLIBCXX ≤ 3.4.21. Jammy has 2.35 and 3.4.30. npm, npx, corepack, the headers and node-gyp are all present.
  • Dropped roots (145 → 116): every fixed HTTPS host in src/ that resolves completes a TLS handshake on 22.23.4 exactly as on 22.22.3. That's 243 hosts via Node and 306 via OpenSSL with each bundle, with zero changes. A chain that ends only at an old root does fail, for example global-root-ca.chain-demos.digicert.com. Customer-configured endpoints are the remaining unknown, and Sudip's post-deploy watch on TLS errors covers them.
  • The fix itself: the 22.23.4 binary rejects both test hosts with CERT_REVOKED. 22.22.3 gets HTTP 200.

[praise] Copying Node from the official image, instead of using NodeSource, ties both images to one pinned release and lets Dependabot move them together. That's cleaner than a version guard.

[fyi · pre-existing] The ut- image's HEALTHCHECK calls wget, which ubuntu:22.04 doesn't ship. NodeSource didn't install it either, and Kubernetes ignores Docker's HEALTHCHECK.

🤖 Context for AI review
  • Head reviewed: b77bc12, base develop.
  • Lanes: Opus blind, Opus adversarial, Codex gpt-6-astra adversarial, Style/Dockerfile. No functional findings. All lanes flagged the expected draft blockers: node:22.23.4-alpine3.24 and node:22.23.4-bookworm-slim return {"manifests":[]} (index sha256:eb37f586…). Do not pin that digest.
  • Root diff method: tls.rootCertificates subjects on Node 22.22.3 vs 22.23.4. Removed: AffirmTrust ×4, COMODO Certification Authority, Certigna, DigiCert Assured ID Root CA, DigiCert Global Root CA, DigiCert High Assurance EV Root CA, Entrust ×3, FIRMAPROFESIONAL CA ROOT-A WEB, GLOBALTRUST 2020, GTS Root R2, QuoVadis Root CA 2 and 3, Secure Global CA, SecureSign Root CA12, SecureTrust CA, SwissSign Gold CA - G2, TeliaSonera Root CA v1, Trustwave ×3, certSIGN, emSign ×3. None added.
  • Host probe: hosts grepped from src/v0/destinations, src/cdk, src/v1/destinations and src/features on develop, tests excluded. tls.connect with the default CA on each Node version gave 236/243 OK on both, and the same 7 fail on both (DNS or dead hosts).
  • amd64: docker run --platform linux/amd64 node:22.23.3-alpine3.24, then apk add make g++ python3, then npm i [email protected] --build-from-source, which exited 0, then an Isolate ran 6*7 and returned 42.

Comment thread Dockerfile-ut-func Resolved
Comment thread Dockerfile-ut-func Resolved
Both tags now list linux/amd64 and linux/arm64, so the RESOLVE markers are replaced with their index digests.
@sonarqubecloud

Copy link
Copy Markdown

@fracasula
fracasula marked this pull request as ready for review October 21, 2026 15:14
@fracasula
fracasula requested review from a team as code owners October 21, 2026 15:14
@fracasula

Copy link
Copy Markdown
Contributor Author

@ItsSudip @lvrach it's out of draft and green. Both FROM lines are now pinned by index digest (node:22.23.4-alpine3.24@sha256:ce8d97f7… and node:22.23.4-bookworm-slim@sha256:5991875d…), the # RESOLVE: lines are gone, and all four image builds passed, amd64 DT included. Leo's two comment suggestions are in as well.

Locally, both final images run Node v22.23.4, and a UT fetchV2 gets CERT_REVOKED from dv-g3b-emudhra.we-have-a-problem.com while example.com still returns 200.

@lvrach lvrach 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.

LGTM. Both digests match the published indexes (amd64 + arm64), all four image builds are green, and the nits are addressed.

Also checked locally on this head: both images build. Node 22.23.4 rejects both eMudhra test hosts with CERT_REVOKED in each image, and /health returns 200.

@fracasula
fracasula merged commit 428344f into develop Oct 21, 2026
51 checks passed
@fracasula
fracasula deleted the fix/node-22.23.4-emudhra-intermediates branch October 21, 2026 15:32
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.

3 participants