Skip to content
Heist/ feed
Back to feed
UnratedFix available

Use-after-free of caller-owned server name in client connection constructors

Type: advisorySources: OSV

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.

Products
rustls-ffi
Affected versions
Not specified
Fixed versions
0.15.7
CVEs
Not specified
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 17:55 UTC · Revision 1

Source evidence

Use-after-free of caller-owned server name in client connection constructors

core-osv · Original source

Published 26 Oct 2026, 12:00 UTC

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.

osv:RUSTSEC-2026-0413

rustls-ffi

Fixed versions: 0.15.7

Complete source record
{
  "id": "3760fed2293aa324f896de39a3f744f9ec36216bb6376f57531f0fa903330404",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2026-0413",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Use-after-free of caller-owned server name in client connection constructors",
    "summary": "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.",
    "evidence": "osv:RUSTSEC-2026-0413",
    "products": [
      {
        "name": {
          "value": "rustls-ffi",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "0.15.7",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "RUSTSEC-2026-0413",
      "aliases": [
        "GHSA-rc3f-4j82-cmrg",
        "RUSTSEC-2026-0413"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.12.0"
                },
                {
                  "fixed": "0.15.7"
                }
              ]
            }
          ],
          "package": {
            "name": "rustls-ffi",
            "purl": "pkg:cargo/rustls-ffi",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": null,
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0413.json",
            "categories": [
              "memory-corruption"
            ],
            "informational": null
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": []
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-27T10:15:12.837053276Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/rustls-ffi",
        "https://rustsec.org/advisories/RUSTSEC-2026-0413.html",
        "https://github.com/rustls/rustls-ffi/releases/tag/v/0.15.7"
      ],
      "provider_metadata": {
        "license": "CC0-1.0"
      }
    },
    "related_cves": [],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 461496,
  "published_at": "2026-10-26T12:00:00+00:00"
}