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


- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 14 Oct 2026
- **Also known as:** RUSTSEC-2026-0346

## What is GHSA-c8m5-c952-6cm4?

GHSA-c8m5-c952-6cm4 is a vulnerability in rustls, published on 14 Oct 2026. 

### Official 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](https://github.com/rustls/rustls/blob/99f2358cae2954837dbb866faf6727de75489ab9/SECURITY.md#boundary-public-api).

### 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](mailto:OutboundDisclosures@openai.com) for the disclosure.

## Which versions are affected by GHSA-c8m5-c952-6cm4?

5 open source packages ship an affected version, including rustls.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rustls` | crates.io | All versions | 0.23.46 |
| `rustls` | crates.io | All versions | 0.23.46 |
| `rustls` | crates.io | From 0.21.0 | 0.23.46 |
| `rustls` | crates.io | From 0.24.0-dev.1 | 0.24.0-dev.2 |
| `rustls` | crates.io | From 0.24.0-dev.1 | 0.24.0-dev.2 |

## How do I fix GHSA-c8m5-c952-6cm4?

Upgrade rustls to a fixed version for your release line: 0.23.46 or 0.24.0-dev.2.

## Is GHSA-c8m5-c952-6cm4 being exploited?

There is no known exploitation of GHSA-c8m5-c952-6cm4 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-c8m5-c952-6cm4 and fix it if it is affected.

What it is: GHSA-c8m5-c952-6cm4 is a vulnerability in rustls, published on 14 Oct 2026. 
Exploitation: There is no known exploitation of GHSA-c8m5-c952-6cm4 in the wild and no public exploit code.

Affected packages and fixed versions:
- rustls (crates.io): affected all versions; fixed in 0.23.46
- rustls (crates.io): affected all versions; fixed in 0.23.46
- rustls (crates.io): affected from 0.21.0; fixed in 0.23.46
- rustls (crates.io): affected from 0.24.0-dev.1; fixed in 0.24.0-dev.2
- rustls (crates.io): affected from 0.24.0-dev.1; fixed in 0.24.0-dev.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-c8m5-c952-6cm4/ (Markdown: https://insights.sbomify.com/GHSA-c8m5-c952-6cm4/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-c8m5-c952-6cm4

---
From sbomify Insights: https://insights.sbomify.com/GHSA-c8m5-c952-6cm4/
Summaries are generated and may contain mistakes; the official description above is the record.
