Skip to content

Fix rustls-webpki and follow-redirects advisories [SECURITY] - #3020

Merged
MarcusSorealheis merged 4 commits into
mainfrom
fix-emsign-follow-redirects-advisories
Oct 22, 2026
Merged

MarcusSorealheis merged 4 commits into
mainfrom
fix-emsign-follow-redirects-advisories

Conversation

@MarcusSorealheis

@MarcusSorealheis MarcusSorealheis commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What and why

Fixes three advisories that dependency scanning still reports after #2987:

  • RUSTSEC-2026-0382 (rustls-webpki < 0.103.16): certificate verification can accept paths through emSign intermediates whose private keys are now public. This is the verifier-side counterpart of the webpki-roots fix in Update Rust crate webpki-roots to v1.0.10 [SECURITY] #2987. 0.103.16 adds a built-in list of the distrusted intermediate public keys and rejects any chain that contains one. Bumped to 0.103.16 in the workspace Cargo.lock and in nativelink-test/fuzz/Cargo.lock, with MODULE.bazel.lock regenerated.
  • GHSA-8r9p-f939-6h3c and GHSA-q3jh-wrc6-jgq8 (npm follow-redirects 1.16.0): on a cross-host redirect, credential headers leak when they are passed as an array, or when a sensitiveHeaders name contains | or ^. The package reaches us only through the Azurite test runner (azurite → axios → follow-redirects), not anything NativeLink ships. Pinned to ^1.16.1 with an override in nativelink-store/tests/azurite_runner/package.json, next to the existing moment and uuid overrides.

These fixes were pushed to #2987's branch after it had merged, so they are not on main. This PR carries them over.

How was this verified?

Each new test fails on the vulnerable version and passes on the fixed one. I checked both directions locally on macOS.

  • tls_verifier_rejects_distrusted_emsign_intermediate_key (nativelink-store/tests/azure_blob_store_test.rs): the test generates a throwaway root with rcgen, which issues two leaf certificates. One carries a distrusted emSign public key (eMudhra's OV TLS CA - G3, taken from rustls-webpki's distrust list); the control has a fresh key. The test runs both through rustls' WebPkiServerVerifier. On 0.103.15 the distrusted leaf verified. On 0.103.16 it fails with CertDistrusted, and the control still verifies. No emSign private key is needed, and no certificate files are committed: the test builds all three certificates itself, in about a millisecond. The distrusted public key is a 97-byte constant in the test, the same public value rustls-webpki ships in its distrust list. rcgen (with only its ring feature) is a new dev-dependency of nativelink-store and also pulls in yasna; MODULE.bazel.lock was regenerated with Bazel 9.3.1.
  • Two cross-host redirect tests in dependency-security.test.cjs: each starts two local servers, 127.0.0.1 redirecting to localhost, and checks which headers the second server received. One sends Authorization as an array-form header; the other declares sensitiveHeaders: ["X-Api|Key"]. On 1.16.0 both credentials reached the second host. On 1.16.1 they are stripped, and a non-sensitive header still gets through.
  • cargo test -p nativelink-store --test azure_blob_store_test: 39 passed.
  • Azurite runner: bun install --frozen-lockfile then bun run test: 6 passed.
  • cargo metadata --locked passes for both Cargo workspaces. Regenerating MODULE.bazel.lock with Bazel 9.1.1 (bazel mod deps --lockfile_mode=update) leaves it unchanged after the bump.
  • cargo clippy on the test target, rustfmt, Biome and typos are clean on the changed files.

Not run locally: the full Bazel build, including the asan and pedantic-Clippy lanes. CI covers those.

Risk

Low. Production code is not modified.

  • rustls-webpki 0.103.16 is a patch release; its only behavior change is rejecting the distrusted emSign keys. A NativeLink deployment talking to an endpoint whose certificate chain runs through one of those intermediates will now get a TLS verification failure, which is the intended fix. Whoever operates that endpoint would notice first.
  • The follow-redirects change affects only the Azurite test runner.
  • The new test-only dependency, rcgen, is not part of the server binary.

AI assistance

Claude Code (Claude Opus 5.5) did this as an agent at my direction. It wrote the lockfile bumps, both sets of tests and this description, and checked each test against the vulnerable versions. Reviewers should look hardest at the certificate generation in the Rust test and the redirect test helper.

🤖 Generated with Claude Code

Bump rustls-webpki to 0.103.16 in the workspace and fuzz lockfiles
(RUSTSEC-2026-0382), which rejects chains through the distrusted emSign
intermediate keys, and override the Azurite runner's follow-redirects to
1.16.1 (GHSA-8r9p-f939-6h3c, GHSA-q3jh-wrc6-jgq8).

Regression tests fail on the previous versions: a rustls verifier test
with a test-root leaf carrying a distrusted emSign key, and cross-host
redirect tests for array-form and metacharacter sensitive headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Oct 22, 2026 6:35pm UTC
nativelink-aidm Ready Ready Preview Oct 22, 2026 6:35pm UTC

Request Review

The forbid-binary-files pre-commit hook rejects DER fixtures. The files
hold public certificates only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build the test root and both leaves with rcgen inside the test instead of
committing certificate fixtures. Generation takes about a millisecond.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MarcusSorealheis
MarcusSorealheis merged commit daa028f into main Oct 22, 2026
32 checks passed
@MarcusSorealheis
MarcusSorealheis deleted the fix-emsign-follow-redirects-advisories branch October 22, 2026 20:24

This branch was successfully deployed

2 active deployments
Preview – nativelink — bece4bb1 Deployed Oct 22, 2026 by vercel[bot]
Preview – nativelink-aidm — bece4bb1 Deployed Oct 22, 2026 by vercel[bot]
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