Repository navigation
fix(docker): pin Bun's TLS trust to the OS CA store - #3040
Merged
Merged
Conversation
Bun embeds its own copy of the Mozilla root store, so the CA bundle fixed by the 2026-10-20 eMudhra intermediate compromise (ca-certificates in Debian/Alpine) does not reach it until Bun ships a release. Pass --use-system-ca so the runtime reads the OS store, which the CI rebuild refreshes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--use-system-ca only adds the OS store to Bun's bundled Mozilla roots, so the emSign roots distrusted after the 2026-10-20 eMudhra compromise stayed trusted (verified in the container). Replace it with a preload that sets the node:tls default CA list to the OS bundle and passes it as tls.ca on every fetch, which ignores that default. --preload must follow `run`: before it, Bun prints the run usage and exits 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tls.setDefaultCACertificates and fetch's tls option are Bun runtime APIs that the installed @types/node and DOM typings predate; talos typecheck rejected them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shahthepro
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
On 2026-10-20, eMudhra TLS intermediates were compromised. The OS CA bundles (Debian, Alpine) are fixed and our CI rebuild picks them up. Bun is not fixed yet: it trusts its own built-in list of root certificates, which still includes the compromised eMudhra roots.
Why the first fix (
--use-system-ca) did not workThe flag does not replace Bun's built-in list with the OS one, it adds the OS list to it. The compromised roots stay in Bun's list, so Bun still trusted the bad certificates. Tested in Docker: with the flag, Bun still connected to the compromised test site.
The fix
contracts/dockerfile-actions:CMD ["bun", "run", "--preload", "./bun-system-ca.ts", "runner.ts"]A small preload script (
./bun-system-ca.ts) makes Bun trust only the OS certificate bundle, for bothfetchandnode:tls/https. The--preloadflag must come afterrun, otherwise Bun prints its help and exits without starting the app.The actions themselves run under Node, which already uses the fixed OS bundle.
Tested (Docker, image built from this branch)
After deploy
Check that
https://dv-g3b-emudhra.we-have-a-problem.com/is rejected and an RPC call works from the new image. Rollback:release:proposewith the previous digest oftalos/origin-dollar(--origin-dollar), see talosinfra/RUNBOOK.md"Roll back a bad deploy".Dockerfile + one script only: no contract, address or ABI change.
🤖 Generated with Claude Code