---
id: RUSTSEC-2026-0413
aliases:
  - GHSA-rc3f-4j82-cmrg
title: Use-after-free of caller-owned server name in client connection constructors
summary: Use-after-free of caller-owned server name in client connection constructors
severity: none
vendor: rustls-ffi
product: rustls-ffi
ecosystem: rust
affected:
  - 'rustls-ffi >= 0.12.0, < 0.15.7'
patched:
  - rustls-ffi 0.15.7
published: '2026-10-26'
updated: '2026-10-27'
sourceUpdated: '2026-10-27T10:15:12.837053276Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/RUSTSEC-2026-0413'
references:
  - url: 'https://crates.io/crates/rustls-ffi'
  - url: 'https://rustsec.org/advisories/RUSTSEC-2026-0413.html'
  - url: 'https://github.com/rustls/rustls-ffi/releases/tag/v/0.15.7'
tags:
  - osv
  - rust
ingestedAt: '2026-10-27T16:20:12.122Z'
---

## Overview

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.

## Affected packages

- `rustls-ffi >= 0.12.0, < 0.15.7`

## Remediation

Upgrade to a patched release:

- `rustls-ffi 0.15.7`
