Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKsGHSA-c8m5-c952-6cm4
MEDIUMFix: rustls/rustls#3299GHSA-c8m5-c952-6cm4 is a medium-severity (CVSS 4) CWE-212 vulnerability in rustls. A fix is available for rustls — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-c8m5-c952-6cm4.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
rustls🦀rustlsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
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] for the disclosure.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | rustls | all versions | 0.23.46cargo update -p rustls --precise 0.23.46 |
| 🦀crates.io | rustls | ≥ 0.24.0-dev.1&&< 0.24.0-dev.2 | 0.24.0-dev.2cargo update -p rustls --precise 0.24.0-dev.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for rustls, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update rustls to 0.23.46 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-c8m5-c952-6cm4 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-c8m5-c952-6cm4 in your dependencies?
Find it across crates.io, including transitive dependencies.