VDB
Sign up
MEDIUM4.0

GHSA-c8m5-c952-6cm4

Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKs

Details

### 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.

Are you affected?

Enter the version of the package you're using.

Affected packages

crates.io/rustls
Introduced in: 0Fixed in: 0.23.46

Upgrade rustls to 0.23.46 or newer (ecosystem crates.io).

crates.io/rustls
Introduced in: 0.24.0-dev.1Fixed in: 0.24.0-dev.2

Upgrade rustls to 0.24.0-dev.2 or newer (ecosystem crates.io).

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:cargo/rustls"]}'