8000 charon: fail the build if a TLS stack is compiled in (CVE-2026-111943) by bryan-minimal · Pull Request #1132 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

charon: fail the build if a TLS stack is compiled in (CVE-2026-111943) - #1132

Merged
bryan-minimal merged 2 commits into
mainfrom
charon-webpki-guard
Oct 28, 2026
Merged

bryan-minimal merged 2 commits into
mainfrom
charon-webpki-guard

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Oct 27, 2026 •
Copy link
Copy Markdown
Member

Part of the CVE-2026-111943 response (gominimal/pkgmgr-rs#1022, the eMudhra intermediate key compromise).

The first fleet pkgmgr truststores run flagged charon: it vendors webpki-roots 1.0.9, which still trusts emSign ECC Root CA - G3. Checking where that crate actually goes:

  • It isn't compiled into what we ship. In charon's Cargo.toml (7980165), reqwest and crates_io_api are optional and enabled only by the popular-crates-test feature, a test that downloads popular crates. The only route to rustls / rustls-webpki / webpki-roots runs through them. build.sh builds --bin charon --bin charon-driver with default features (rustc, minirust).
  • The built artifact agrees. The cached charon output for main's spec hash (cache.minimal.dev, artifact 1973bf26…) has no webpki / rustls / reqwest strings, and none of the 53 packages/ca-certificates/distrust.txt cert or SPKI hashes. The same scanner finds emSign G3 and AAA in a pre-fix bundle (positive control).

So a lock bump would only change the vendor tarball, with no effect on the binaries. This PR doesn't do that. It adds a build-time guard that keeps the verdict true. After the cargo build step, build.sh now:

  1. requires target/release/deps/libserde-*.rlib to exist (positive control, so the check can't pass by looking in the wrong place);
  2. fails if any rustls, rustls_webpki, webpki_roots, webpki_root_certs or reqwest rlib was compiled. The error says to lock rustls-webpki >= 0.103.16 / webpki-roots >= 1.0.10 first.

If a future charon bump turns the TLS stack on by default, the build fails instead of quietly shipping the pre-fix roots.

Verification: not built locally. This PR's build is the test: the charon build must pass, with the guard silent. Changing build.sh changes charon's spec hash, so charon and its dependents (aeneas) rebuild.

Follow-up for the scanner (pkgmgr-rs): an uncompiled vendored crate source is the same no-action class as rust's vendored webpki-roots 0.26.3. It should be classified, not reported as a hit.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • The default-feature build now checks its compiled dependencies and fails if expected libraries are missing or certain optional libraries are included.

charon's Cargo.lock pins webpki-roots 1.0.9 (trusts emSign ECC Root CA - G3)
and rustls-webpki 0.103.4, and the vendor tarball carries both, so the
trust-store scan flags charon. Neither is compiled: reqwest / crates_io_api
sit behind the optional `popular-crates-test` feature, and the built
charon / charon-driver carry no webpki, rustls or reqwest strings and no
denylisted certificate or SPKI.

Make that verdict durable: after the build, require a libserde rlib in
target/release/deps (positive control) and fail if any rustls,
rustls-webpki, webpki-roots, webpki-root-certs or reqwest rlib is there.

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 27, 2026 20:56
@coderabbitai
coderabbitai Bot commented Oct 27, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 756166c and 3f62db9.

Files selected for processing: 1
  • packages/charon/build.sh

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Walkthrough

After building the default-feature binaries, build.sh scans Cargo-reported build and target directories for .rlib files. It fails if serde is absent or if it finds compiled artifacts for rustls, rustls-webpki, webpki-roots, webpki-root-certs, or reqwest.

Changes: Charon build artifact guard

Layer / File(s) Summary
Default-build artifact validation
packages/charon/build.sh
After the default-feature build, the script searches Cargo-reported build and target directories. It fails if it finds no serde .rlib or finds an .rlib for a listed TLS-related crate.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • gominimal/pkgmgr-rs#1022 — Tracks the CVE-2026-111943 response and lists Rust tools with bundled roots as affected work. This PR adds a build-time check for a related TLS stack in charon.

Possibly related PRs

  • gominimal/pkgs#817 — Addresses the same certificate compromise with package-level certificate changes.
  • gominimal/pkgs#1114 — Addresses the same trust issue by switching consumers to Chromium.

Suggested reviewers: norrietaylor

Merge Risk: Minimal · up to 3f62d

No concrete merge-blocking issue was established. The charon build should still be run to confirm the guard in its package environment.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding a build failure guard when a TLS stack is compiled into charon. It also identifies the relevant CVE.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

…d in target/release/deps)

The first build of this guard failed its own positive control on both arches:
'no libserde rlib in target/release/deps' although the build finished and the
binaries are in target/release (newer cargo keeps intermediate artifacts in a
separate build directory). Search cargo metadata's build_directory and
target_directory recursively instead; serde stays the positive control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mitodrummer mitodrummer left a comment
8000
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.

Confirmed in charon's Cargo.toml at 7980165 that reqwest and crates_io_api are optional and only enabled by popular-crates-test, while defaults are rustc and minirust, so the TLS stack is not compiled into this build. The guard has a serde positive control and runs under set -eu without pipefail, so the grep -q pipelines are safe. The charon build is green on the head with the guard silent.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit bde91a3 Oct 28, 2026
12 checks passed
@bryan-minimal
bryan-minimal deleted the charon-webpki-guard branch October 28, 2026 20:13
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

0