NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Rust (crates.io)

GHSA-c8m5-c952-6cm4: Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKs

mediumCVSS 3.1 4.0

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 rustls

Then 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 rustls

The 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

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) entries