GHSA-c8m5-c952-6cm4: Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKs
The rustls crate derived Debug for Tls12ClientSessionValue and Tls13ClientSessionValue, so formatting one prints the TLS 1.2 master secret or TLS 1.3 resumption PSK. Only custom ClientSessionStore implementations that log these values are exposed. Upgrade to rustls 0.23.46, or 0.24.0-dev.2 on the 0.24 development line.
Published Oct 27, 2026 · Analysis Nov 1, 2026
What an attacker can do
The two session value types hold secret key material. Their Debug output was generated by derive, so it walked every field, including the master secret (TLS 1.2) and the resumption PSK (TLS 1.3). This breaks rustls's own key-material redaction policy.
The leak needs a specific mistake in application code. A custom ClientSessionStore must pass one of these values to a Debug formatter, for example in a {:?} log line or a tracing field. Anyone who can then read those logs gets the secret. With a master secret or resumption PSK, a reader could decrypt recorded traffic of that session or resume it, depending on what else they hold.
Ordinary connection diagnostics and the built-in session cache already print redacted output and are not affected. The session-store interface also already warns that its values are sensitive. The CVSS vector (local, high complexity, high privileges, user interaction) reflects how narrow this is. OpenAI reported the issue.
Who is affected
Applications that use rustls as a TLS client and implement their own ClientSessionStore that formats the session values with Debug. RustSec treats versions from 0.21.0 up to but not including 0.23.46 as affected, and the GitHub advisory also lists 0.24.0-dev.1. Check the resolved version in your lockfile:
cargo tree -i rustlsThen search your own store code and log statements for Debug formatting of the session values.
rustls
- Ecosystem
- Rust (crates.io)
- Affected
- < 0.23.46
- Fixed in
- 0.23.46
- Check
cargo tree -i rustls
rustls
- Ecosystem
- Rust (crates.io)
- Affected
- >= 0.24.0-dev.1, < 0.24.0-dev.2
- Fixed in
- 0.24.0-dev.2
- Check
cargo tree -i rustls
How to fix it
Upgrade to rustls 0.23.46. Users of the 0.24 development line need 0.24.0-dev.2.
cargo update -p rustlsThe advisory lists no workaround. Until you upgrade, do not format Tls12ClientSessionValue or Tls13ClientSessionValue with Debug in a custom store. Rotate any logs that may already hold these values.
How to tell if you were hit
Grep your logs and log pipelines for session-store output. Look at the code of any custom ClientSessionStore for {:?}, dbg! or tracing fields that print stored values. If such a line has run on an affected version, treat the logged master secrets and PSKs as exposed and restrict or purge those logs. Without a custom store, there is nothing to find.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Formatting a client session value with Debug exposes its TLS 1.2 master secret or TLS 1.3 resumption PSK. A custom session store that logs these values can disclose keys to readers of the logs. Ordinary connection and built-in cache diagnostics remain redacted, and the session-store interface already warns that its values are sensitive.
Details
Derived formatters traverse the session's secret-bearing fields. This conflicts with the project's explicit key-material redaction policy.
Proof of concept
Custom ClientSessionStore implementations could leak secret data by using the provided Tls12ClientSessionValue or Tls13ClientSessionValue in a way that triggers its implementation of the Debug trait.
Impact
Such store implementations could leak the master secret for the TLS connection.
Acknowledgement
Thanks to OpenAI [[email protected]](mailto:[email protected]) for the disclosure.
Questions
- Does this affect every rustls client?
No. The built-in session cache prints redacted output. Only a custom ClientSessionStore that formats Tls12ClientSessionValue or Tls13ClientSessionValue with Debug leaks the secret.
- Which rustls version fixes GHSA-c8m5-c952-6cm4?
0.23.46 for the stable line and 0.24.0-dev.2 for the 0.24 development line. The fix is in rustls pull request 3299.
- Is it exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog. It also has no CVE id. It needs log access and a custom store that logs session values.
References
Read for this analysis:
- https://github.com/rustls/rustls/security/advisories/GHSA-c8m5-c952-6cm4
- https://rustsec.org/advisories/RUSTSEC-2026-0346.html
- https://github.com/rustls/rustls/pull/3299
- https://github.com/rustls/rustls/pull/3354
- https://github.com/rustls/rustls/commit/dcdb9464d376f45f42a94a5f837cda1506449f23
- https://github.com/rustls/rustls/commit/f5f7bf5078a7edcbd81a9e82a97f2bd14dc1c855
- https://github.com/rustls/rustls/releases/tag/v/0.23.46
- https://github.com/advisories/GHSA-c8m5-c952-6cm4
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesGHSA-h2v8-394m-p7vv
Rustls: Brotli certificate decompression can allocate an attacker-controlled amount of memory up to 1 GiB before authentication.
low3.7Oct 27, 2026GHSA-vp88-798v-h67f
rustls: ECH rejection can expose buffered application data to authenticated outer server before `ech_required` alert
low2.3Oct 27, 2026GHSA-w44r-93j7-qv28
rustls: An unauthenticated ServerHello poisons the per-name key-exchange record, so later ClientHellos carry only a classical X25519 share
low3.7Oct 27, 2026GHSA-2mjx-qc3c-rqvc
Rustls: TLS 1.3 handshake messages incorrectly accepted across encryption level boundaries
medium5.3Oct 5, 2026GHSA-qg5g-gv98-5ffh
rustls network-reachable panic in `Acceptor::accept`
medium6.9Nov 25, 2024CVE-2024-32650
Denial of Service Vulnerability in Rustls Library
high7.5No fixApr 19, 2024
