fix(deps): bump rustls to 0.23.46 for RUSTSEC-2026-0346..0349 (#4222)

## Description

The blocking `Rust advisories (cargo audit)` gate in `security.yml`
fails on `main` (the `Security` run on 76133cff) and on every open PR.
On 2026-10-14 RustSec published four advisories against `rustls`
0.23.45, the version in `Cargo.lock`:

- RUSTSEC-2026-0346: `Debug` impls for client session values expose TLS
secrets
- RUSTSEC-2026-0347: buffered application data sent to the outer server
after ECH rejection
- RUSTSEC-2026-0348: Brotli certificate decompression can allocate up to
1 GiB before authentication
- RUSTSEC-2026-0349: an unauthenticated ServerHello can downgrade later
connections to classical key exchange

All four are fixed in 0.23.46. This PR moves the lock to that patch
release and changes nothing else.

## Type of Change

- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)

## Changes Made

- `Cargo.lock`: `rustls` 0.23.45 -> 0.23.46 (`cargo update -p rustls
--precise 0.23.46`), version and checksum only. No other crate moved,
and no `Cargo.toml` changed.

## Testing

- [ ] Unit tests pass (`pytest`)
- [ ] Linting passes (`ruff check .`)
- [ ] Type checking passes (`mypy headroom`)
- [ ] New tests added for new functionality
- [x] Manual testing performed

### Test Output

```text
$ cargo audit --file <origin/main Cargo.lock>
Crate:     rustls
Version:   0.23.45
ID:        RUSTSEC-2026-0346
ID:        RUSTSEC-2026-0347
ID:        RUSTSEC-2026-0348
ID:        RUSTSEC-2026-0349
error: 4 vulnerabilities found!

$ cargo audit            # this branch
    Scanning Cargo.lock for vulnerabilities (546 crate dependencies)
exit=0

$ cargo check --workspace --all-targets --locked
Finished `dev` profile [unoptimized + debuginfo] target(s) in 57.24s

$ ORT_DYLIB_PATH=<onnxruntime 1.31.0 dylib> cargo test --workspace --locked --no-fail-fast
passed=1657 failed=1 ignored=3 (68 test binaries)
FAILED: magika_session_does_not_spawn_intra_op_pool (macOS only; fails identically on origin/main, see Additional Notes)
```

## Real Behavior Proof

- Environment: macOS arm64, Rust 1.95.0 (rust-toolchain.toml),
cargo-audit 0.22 with the RustSec advisory DB fetched 2026-10-15
- Exact command / steps: `cargo audit` against origin/main's Cargo.lock,
then against this branch; `cargo check --workspace --all-targets
--locked`; `cargo test --workspace --locked` with `ORT_DYLIB_PATH` set
as in rust.yml
- Observed result: main reports 4 rustls vulnerabilities (exit 1), this
branch reports none (exit 0); the workspace builds and the Rust tests
pass apart from one macOS-only test that fails on main too
- Not tested: Python tests (no Python change); Windows and Linux Rust
builds (CI covers them)

## Runtime Rollout Safety

- Rollout-managed feature(s): none
- Minimum rollout channel: stable
- Stable/default behavior changed: no; patch-level TLS library fix with
the same API
- Kill switch / disable path: not applicable
- Unsafe override required: no
- Qualification impact: none
- Rollback path: revert this commit to restore the 0.23.45 lock entry

## Review Readiness

- [x] I have performed a self-review
- [x] This PR is ready for human review

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] I did **not** edit `CHANGELOG.md` — it is generated by
release-please from my Conventional Commit PR title (a CI guard enforces
this)

## Screenshots (if applicable)

N/A

## Additional Notes

- N/A items: no code comments, docs or new tests apply to a
lockfile-only patch bump; the passing `cargo audit` gate is the
regression check.
- Dependabot's open cargo group (#4186) predates these advisories and
does not bump `rustls`.
- `magika_session_does_not_spawn_intra_op_pool` counts OS threads on
macOS and fails locally on `origin/main` as well (`before=2, after=10`).
CI runs the Rust tests on Linux, so this PR does not affect it.
- Once this lands, open PRs need `main` merged in to clear the audit
check.

<!-- devin-review-badge-begin -->

---

<a href="https://app.devin.ai/review/headroomlabs-ai/headroom/pull/4222"
target="_blank"><picture><source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img
src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4"
alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->

Co-authored-by: Kenneth Wong <17061293+KennethWKZ@users.noreply.github.com>
This commit is contained in:
Kenneth Wong
2026-10-15 12:52:22 -05:00
committed by GitHub
co-authored by Kenneth Wong
parent 76133cff59
commit 132dbc7699
Generated
+2 -2
View File
@@ -3863,9 +3863,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.45"
version = "0.23.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634"
checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
dependencies = [
"aws-lc-rs",
"log",