# GHSA-rc3f-4j82-cmrg: Use-after-free of caller-owned server name in client connection constructors

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-10-26T12:00:00.000Z
- Modified: 2026-10-27T10:15:12.837Z
- Also known as: RUSTSEC-2026-0413

## Description

In rustls-ffi 0.12.0 through 0.15.6, `rustls_client_connection_new()` and
`rustls_client_connection_new_alpn()` retained a reference to the caller's
`server_name` buffer after returning, rather than copying it. The API
documentation did not require the buffer to outlive the call and as a result
if the caller freed or reused the buffer, later TLS processing read freed
memory.

Clients that free or reuse the `server_name` buffer after the constructor
returns are affected. This is most likely for language bindings that pass
temporary strings. Callers that keep the `server_name` buffer alive for the
lifetime of the `rustls_client_config` are not affected.

Versions 0.12.0 through 0.15.6 are affected. Version 0.15.7+ changed these APIs
to copy the input buffer.

(As written by RustSec Advisory Database.)

## Affected

- rustls-ffi (crates.io): from 0.12.0 before 0.15.7

## References

- <https://crates.io/crates/rustls-ffi> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0413.html> (advisory)
- <https://github.com/rustls/rustls-ffi/releases/tag/v/0.15.7> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0413](https://rustsec.org/advisories/RUSTSEC-2026-0413.html), CC0-1.0, modified 2026-10-27

---

Page: https://cve.day/GHSA-rc3f-4j82-cmrg · Whole record: https://cve.day/GHSA-rc3f-4j82-cmrg.json · Rebuilt by cve.day 2026-11-25T22:56:43.456Z
