Skip to content

fix: reject compromised eMudhra keys in Rust clients - #157

Merged
joshavant merged 2 commits into
mainfrom
security/emudhra-rust-tls
Oct 21, 2026
Merged

joshavant merged 2 commits into
mainfrom
security/emudhra-rust-tls

Conversation

@joshavant

@joshavant joshavant commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The experimental Rust client's locked TLS dependencies can accept chains containing the compromised eMudhra intermediate keys.

User Impact

Future native Rust client builds consume WebPKI 0.103.16 and webpki-root-certs 1.0.10. Existing built clients still need replacement builds. Platform-native/custom-store behavior and deployment remain separate verification/update work; no protocol or application settings change.

Why This Change Was Made

Regenerate the owning lock with compatible released verifier/root-data fixes. Cargo also normalizes tempfile's allowed dependency edge from the existing getrandom 0.4.3 to existing 0.3.4; no additional package versions change. The Go connector's existing fixed compiler is independent. See the upstream WebPKI advisory and root-data advisory.

Evidence

  • Secretless task-owned Linux arm64 VM: Rust workspace 109 tests pass; one existing real-Chromium interoperability test remains ignored. Required pnpm check, pnpm test (223 tests) and pnpm test:native (Go race tests and vet) pass. The lead independently reran all three required pnpm gates.
  • Actual selected Rustls/WebPKI verifier with the affected 150-root CA data accepts all twelve disclosed chains before the dependency update and rejects all twelve with CertDistrusted after it. This exact-library proof is shared with the core lock update; it does not substitute for macOS/Windows native verifier or authenticated application tests.
  • The initial workspace setup lacked media development packages. Subsequent two WebRTC failures were traced to the isolated guest firewall blocking its own ICE candidates; allowing only guest-self/loopback traffic restored those tests, retaining all private-peer restrictions. No application workaround or test weakening was added.
  • Independent P0–P2 review found no actionable findings; registry checksums, Cargo resolution and git diff --check pass.
  • macOS/Windows, real host/media/browser interoperability, WASM release packaging and installed-client rollout are not claimed by the Linux checks. No manual release publication or deployment is performed. The maintainer explicitly authorized this merge’s existing production Worker deployment and configured migration effects.

Landing qualification

Added the required dense Unreleased changelog line. The new head changes only CHANGELOG.md relative to the reviewed dependency update. The lead reran pnpm check, pnpm test (223 passed), and pnpm test:native (Go race tests and vet passed) in the isolated Linux guest with that exact changelog; the first runner setup failed before tests and is not counted as passing proof. Prior Rust workspace and actual selected WebPKI verifier evidence remains applicable because dependency/source inputs are unchanged. macOS/Windows native verifier and authenticated product-flow limits above remain; the advisory expanded proof request identified no additional source defect. Existing main-push Worker deployments and configured migrations are authorized; no manual tag, release or deploy dispatch is initiated.

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

Updates the Rust client's certificate verifier and bundled roots to reject disclosed eMudhra incident keys.

Example: A TLS peer presents an emSign intermediate with a compromised public key under an otherwise trusted chain.

  • Before: WebPKI 0.103.15 can accept the chain.
  • After: WebPKI 0.103.16 rejects the chain with CertDistrusted.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and has no remaining code finding, but supplied evidence does not establish the changed production trust boundary.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An affected Rust build can trust an impersonating service presenting a certificate path containing compromised intermediate keys.
Reason: Published security fixes repair existing certificate authentication without adding settings or changing the application protocol; existing binaries still need replacement builds.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: main still pins advisory-affected TLS dependencies, and the focused security update remains necessary; the previous changelog finding is resolved.

Priority: P1
Reviewed head: 2c6e2d9bc5a22b956344689abd66c391a9c88211

Before merge

  • Add real behavior proof - Authority-chain proof required: the Linux arm64 narrative reports twelve direct-library rejections but supplies no linked terminal output through the native account/signaling or gateway TLS owners, and the inspected historical UI captures do not exercise this change. Attach redacted runtime logs showing a valid peer succeeds and a peer using a compromised intermediate receives no credentials or signaling tokens through the actual production TLS clients. Redact IPs, keys, account details, and non-public endpoints. No persisted authority or revocation behavior changes here. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a production TLS trace showing an ordinary valid peer succeeds while a compromised-intermediate peer is rejected before receiving credentials or signaling tokens; the reported library checks have no inspectable output.
Agent review details

How this fits together

The native Rust client and Rust web gateway send account credentials and signaling tokens through HTTPS and secure WebSocket transports whose TLS dependencies authenticate upstream peers.

flowchart LR
 Native[Native Rust viewer] --> Cloud[Cloud account and signaling]
 Browser[Browser viewer] --> Gateway[Rust web gateway]
 Cloud --> TLS[TLS peer verification]
 Gateway --> TLS
 TLS --> Upstream[Account and signaling services]
Loading

Technical review

Best possible solution:

Retain the focused upstream dependency repair and distribute replacement Rust builds after verifying the production TLS boundary.

Do we have a high-confidence way to reproduce the issue?

Main selects advisory-affected versions through Rustls transports, establishing the affected source path when configured trust anchors permit the compromised chain; this review did not execute an exploit.

Is this the best way to solve the issue?

Updating the owning lockfile to the upstream patched releases is the smallest complete repair, and the tempfile dependency normalization remains within its published requirement.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8f1e8a8ebe6e.

Provenance checked

  • Rust verifier and root-data pins changes intended behavior with a stated reason (2f3b0d4: The independent Rust client introduced verified account and signaling transports; subsequent merged dependency updates preserved that architecture.)
  • tempfile getrandom dependency edge keeps the original intent (2f3b0d4: The original lock selected getrandom 0.4.3; the PR records Cargo normalization, and registry metadata also permits the existing 0.3.4 version.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Exact introduced changes: The pinned diff updates rustls-webpki 0.103.15 to 0.103.16 and webpki-root-certs 1.0.9 to 1.0.10, updates their checksums, normalizes tempfile's getrandom edge, and adds one Unreleased changelog entry. (client/Cargo.lock:3722, 2c6e2d9bc5a2)
  • Production TLS boundary: The manifests select Rustls. Native account credentials reach reqwest's HTTPS send; native signaling performs the TLS handshake before emitting Opened and sending account messages. Gateway HTTPS and WebSocket forwarding similarly use real TLS clients. (client/cloud/src/auth/native.rs:70, 2c6e2d9bc5a2)
  • Published affected and patched ranges: RUSTSEC-2026-0382 identifies compromised intermediate-key acceptance and patches the selected release line at 0.103.16; RUSTSEC-2026-0383 patches the bundled root data at 1.0.10. (crates/rustls-webpki/RUSTSEC-2026-0382.md)
  • Upstream rejection implementation: Merged 0.103.16: reject cert paths containing distrusted SPKIs rustls/webpki#546 adds distrusted-SPKI checks during chain construction, including trust anchors, and returns CertDistrusted; the target imports this verifier through its selected TLS dependencies. (src/verify_cert.rs, 8ecdcc76f56b)
  • Upstream root removal: Merged webpki-roots|webpki-root-certs: Prepare 1.0.10, remove emSign root rustls/webpki-roots#133 removes emSign ECC Root CA - G3 from the 1.0.10 root data consumed by the locked dependency. (webpki-root-certs/Cargo.toml, 70760478b9d3)
  • Registry integrity and compatible normalization: Both patched release checksums match the lockfile and neither release is yanked; tempfile 3.27.0 permits getrandom >=0.3.0,<0.5, covering the changed edge. (te/mp/tempfile)

Likely related people:

  • Peter Steinberger: Raw commit 2f3b0d4 adds client/cloud/src/auth/native.rs:70 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2f3b0d45e80c; files: client/cloud/src/auth/native.rs)

Labels

Label changes:

No label changes.

Label justifications:

  • P1: Published advisories identify compromised certificate keys accepted by dependencies still pinned on main, potentially exposing account credentials or signaling tokens.
  • merge-risk: 🚨 security-boundary: The update changes which TLS peers can receive application secrets, so ordinary passing CI cannot establish the final security boundary.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add final-effect proof through the application's TLS owners that a valid peer succeeds and a compromised-intermediate peer receives no credentials or signaling tokens.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-21T08:04:56.697Z sha 1dc1208 :: needs real behavior proof before merge. :: [P3] Document the security update under Unreleased

Reviewed October 21, 2026, 5:06 AM ET / 09:06 UTC (Revision 2).

@joshavant

Copy link
Copy Markdown
Contributor Author

Added the required Unreleased changelog line; only CHANGELOG.md changed from the reviewed dependency update. The lead reran all three required pnpm gates successfully on this head; validation and platform limits are current in the PR body.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 21, 2026
@joshavant
joshavant merged commit 3175906 into main Oct 21, 2026
14 checks passed
@joshavant
joshavant deleted the security/emudhra-rust-tls branch October 21, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant