Skip to content

fix: close TLS distrust gaps across modern and legacy runtimes - #3

Draft
mikkel wants to merge 3 commits into
mainfrom
security/october-2026-runtime-fixes
Draft

mikkel wants to merge 3 commits into
mainfrom
security/october-2026-runtime-fixes

Conversation

@mikkel

@mikkel mikkel commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Close emSign trust gaps in both Rust TLS branches and update the Node/Python runtimes selected by the Docker builds. The libsql branch retains Rustls 0.22.4 and needs its own verifier fix.

  • Update modern webpki to 0.103.16, roots to 1.0.10, and Rustls0.23.46/Quinn0.11.19 security patches plus separate webpki-root-certs1.0.10.
  • Backport upstream SPKI distrust into the checksum-verified ISC-licensed legacy crate as 0.102.9+security.emudhra.1. Preserve its API and ordinary signature, name, expiry and trust-anchor checks.
  • Pin Node 22.23.4 and Python 3.12.15 image digests; align the worker default and refresh frontend/E2E dependencies. Verified Playwright 1.64.1 separately embeds Node 24.22.1.
  • Add an offline regression gate for 12 direct/cross-signed incident chains and a legitimate control.

Change Type

  • Security
  • Dependencies
  • CI/Infrastructure

Linked Issue

This fork disables issues. Remaining legacy name-constraint/CRL advisories are explicitly documented in vendor/PATCHES.md; this PR does not claim that entire old branch patched. Latest compatible libsql 0.9.30 and stable 0.10.0 both retain hyper-rustls 0.25, so an unqualified database API upgrade would not remove it.

Official sources: SPKI distrust, root removal, Node October fixes, CPython SNI fix, certifi, wheel.

Validation

  • Initial patch qualification: formatting and312 architecture tests at760f89e; dependency follow-up uses focused network tests.
  • Current compatible Rust graph:56 network tests and real12-chain TLS rejection with healthy HTTPS control. Initial Railway worker35 tests passed.
  • Initial frontend graph:1,320 tests passed. Current refreshed graph: TypeScript, production build, bundle budgets and8 focused renderer/KaTeX security tests passed. Broad default test run hit9 CPU-load timeouts; bounded full rerun exceeded300 seconds.
  • Real sandbox image build/Python 3.12.15 execution; E2E package build and dependency check.
  • Real modern Rust and embedded Playwright Node clients reject all 12 incident chains and accept legitimate HTTPS.
  • Real legacy TLS client with controlled legacy roots accepts all 12 before the patch and rejects all 12 afterward, preserving legitimate HTTPS.
  • Offline captured-chain test fails against the original crate and passes against the backport. The restored upstream suite plus new regression passes 344 tests.

Test Strategy

User behavior: ordinary HTTPS works; compromised keys fail even under an old root or alternate cross-sign.

Risk areas: security, TLS providers, sandbox image compatibility, frontend and E2E tooling.

Tests added or updated:

  • Unit/contract: existing network/worker suites and upstream legacy verifier tests.
  • Reborn integration: no authorization/schema change; worker transport tests cover existing arguments and image alignment.
  • Recorded fixture: 13 chains at a fixed verification instant. Deliberately old AAA/G3 anchors are verified official certifi data used only in tests; certificate validation is never disabled.
  • Browser E2E: frontend tests/build qualified. Full application journeys require a running service and were not run.
  • Backend/runtime: real worker container and both verifier TLS probes. No live Railway worker/database changed.
  • Live canary: not applicable to source remediation; no account mutations or paid provider calls.

What the tests prove: the actual legacy acceptance defect is reproduced and the targeted backport closes it without breaking legitimate verification. They do not establish versions in existing deployments.

Commands run: cargo fmt --all -- --check; architecture/network/worker cargo test suites; standalone vendored verifier tests; pnpm test/typecheck/build; uv build/dependency check; actual container and TLS probes.

Remaining open findings and qualification

This PR is a tested partial source remediation and must remain draft while required CI fails. No ignore/bypass is added.

  • Existing Wasmtime47.0.3/WASI sandbox and ZIP8.6.0 advisories require qualified major upgrades (at least Wasmtime48.0.7 and ZIP9).
  • Legacy libsql retains Rustls0.22.4, h2.3.27 and separate verifier name-constraint/CRL advisories. Only targeted compromised-key distrust is backported; Rustls session-secret Debug/downgrade issues remain unresolved on that branch.
  • Complete OSV query of912 registry package/versions across both Rust locks records17 remaining affected/advisory packages, including unsupported libraries and optional native graphs. A lock match alone does not establish active runtime reachability.
  • Repository CI also fails an existing current-stable Clippy chunks_exact lint and recorded-QA promotion metadata86 days old. No success timestamp was invented.
  • Standalone harness lock uses the same verifier backport and current compatible TLS patches; full cargo check exceeded a bounded360-second build and is unqualified.
  • Architecture video development graph updated compatibly; clean install, TypeScript/ESLint and Remotion production bundle pass.
  • KaTeX override0.18.2 is qualified by actual before/after inherited-trust reproduction plus ordinary math; Mermaid/Undici/source-map security updates retain frontend builds and focused real renderer tests.

Security Impact

Eight exact upstream SPKIs are blocked. Preserve UnknownIssuer diagnostics for compatibility. Original license notices, crate checksum, source/fixture commit hashes and all DER hashes are retained in vendor/SECURITY-BACKPORT.json. Only documentation headings and whitespace in OpenSSL textual annotations are normalized; encoded PEM data is verified unchanged. Negative-test anchors never enter production default trust.

Reborn Trust-Boundary Checklist

No new public policy/evidence types, enum variants, secret paths or network bypasses. Existing verifier checks remain enabled. The worker image default stays aligned with its Dockerfile; arguments and authorization boundaries are unchanged.

Database Impact

No schema, migrations or live data changes. The libsql API version is unchanged.

Blast Radius

Rebuilt TLS clients, sandbox image and frontend/E2E tooling. Existing installations/processes remain unverified. Automatic release jobs are guarded for upstream nearai, not this fork.

Rollback Plan

Revert and rebuild the previous artifact. Removing distrust reopens compromised-key acceptance; retain isolation and updated system trust while correcting it. No database rollback or protected workload restart is needed.

@mikkel
mikkel marked this pull request as draft October 23, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant