GHSA-c8m5-c952-6cm4 RUSTSEC-2026-0346
Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKs
- Severity
- 4.0 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- —
- No score published
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-212 Improper Removal of Sensitive Information Before Storage or Transfer
- Fix
0.23.46- Upgrade rustls to this version or later
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 OutboundDisclosures@openai.com for the disclosure.
Affected versions
crates.io
| Package | Vulnerable | Fixed in |
|---|---|---|
| rustls | < 0.23.46 |
0.23.46 |
| rustls | >= 0.24.0-dev.1, < 0.24.0-dev.2 |
0.24.0-dev.2 |
| rustls | >= 0.21.0, < 0.23.46 |
0.23.46 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
rustls crates.io → 0.23.46
- cargo
cargo update -p rustls --precise 0.23.46
Severity breakdown
CVSS 3.1 4.0
CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N
- Attack vector
- Local
- Attack complexity
- High
- Privileges required
- High
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Weakness
CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer
The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors.
How to prevent it
- Requirements: Clearly specify which information should be regarded as private or sensitive, and require that the product offers functionality that allows the user to cleanse the sensitive information from the resource before it is published or exported to other parties.
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
- Implementation, Operation: Some tools can automatically analyze documents to redact, strip, or "sanitize" private information, although some human review might be necessary. Tools may vary in terms of which document formats can be processed. When calling an external program to automatically generate or convert documents, invoke the program with any available options that avoid generating sensitive metadata. Some formats have well-defined fields that could contain private data, such as Exchangeable image file format (Exif), which can contain potentially sensitive metadata such as geolocation, date, and time [REF-1515] [REF-1516].
- Implementation: Use naming conventions and strong types to make it easier to spot when sensitive data is being used. When creating structures, objects, or other complex entities, separate the sensitive and non-sensitive data as much as possible.
- Implementation: Avoid errors related to improper resource shutdown or release (CWE-404), which may leave the sensitive data within the resource if it is in an incomplete state.
References
Packages
Other links
- github.com/rustls/rustls/security/advisories/GHSA-c8m5-c952-6cm4
- github.com/rustls/rustls/pull/3299
- github.com/rustls/rustls/pull/3354
- github.com/rustls/rustls/commit/dcdb9464d376f45f42a94a5f837cda1506449f23
- github.com/rustls/rustls/commit/f5f7bf5078a7edcbd81a9e82a97f2bd14dc1c855
- github.com/rustls/rustls/releases/tag/v/0.23.46
- rustsec.org/advisories/RUSTSEC-2026-0346.html
Timeline
- Published
- Last updated by the source
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-vp88-798v-h67f rustls: ECH rejection can expose buffered application data to authenticated outer server before `ech_required` alert | Low | Also affects rustls |
| GHSA-w44r-93j7-qv28 rustls: An unauthenticated ServerHello poisons the per-name key-exchange record, so later ClientHellos carry only a classical X25519 share | Low | Also affects rustls |
| GHSA-h2v8-394m-p7vv Rustls: Brotli certificate decompression can allocate an attacker-controlled amount of memory up to 1 GiB before authentication. | Low | Also affects rustls |
| GHSA-2mjx-qc3c-rqvc Rustls: TLS 1.3 handshake messages incorrectly accepted across encryption level boundaries | Medium | Also affects rustls |
| GHSA-qg5g-gv98-5ffh rustls network-reachable panic in `Acceptor::accept` | High | Also affects rustls |
| GHSA-6g7w-8wpp-frhj Denial of Service Vulnerability in Rustls Library | High | Also affects rustls |
| GO-2026-5618 Argo CD: Kubernetes Secret Extraction via ArgoCD ServerSideDiff via sensitive annotations | Medium | Same weakness, CWE-212 |
| GHSA-q7f2-rv22-2xgr FacturaScripts Vulnerable to Unstripped Image Metadata (EXIF) Leakage via Library Module File Upload/Download | Medium | Same weakness, CWE-212 |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor