---
id: "GHSA-vp88-798v-h67f"
kind: "vulnerability"
aliases: ["GHSA-vp88-798v-h67f"]
title: "rustls: ECH rejection can expose buffered application data to authenticated outer server before `ech_required` alert"
severity: "low"
cvss: 2.3
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "rustls", "fixed": ["0.23.46"], "affected": ">= 0.23.44, < 0.23.46", "ecosystem": "cargo"}, {"name": "rustls", "fixed": ["0.24.0-dev.2"], "affected": ">= 0.24.0-dev.1, < 0.24.0-dev.2", "ecosystem": "cargo"}]
ecosystems: ["cargo"]
tags: ["client-tls", "cwe-200", "ech", "package", "rust", "rustls"]
not_affected_if: ["default-config", "grease-ech-only", "no-ech"]
published_at: "2026-10-27T16:08:59+00:00"
first_seen_at: "2026-10-27T16:10:07+00:00"
updated_at: "2026-10-27T16:10:58+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-vp88-798v-h67f", "first_seen_at": "2026-10-27T16:10:07+00:00"}]
---

# rustls: ECH rejection can expose buffered application data to authenticated outer server before `ech_required` alert

When a server rejects Encrypted Client Hello, rustls 0.23.44 and 0.23.45 still send application data the client buffered before the handshake finished, to the outer server named by public_name. That server is authenticated, so an attacker does not gain access, but plaintext meant for the inner server reaches the wrong party.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- cargo:rustls affected >= 0.23.44, < 0.23.46 fixed 0.23.46
- cargo:rustls affected >= 0.24.0-dev.1, < 0.24.0-dev.2 fixed 0.24.0-dev.2

## How to check

- Run `cargo tree -i rustls` and look for `rustls` at `0.23.44` or `0.23.45`, or `0.24.0-dev.1`.
- Search the project for `EchMode::Enable` and for code that writes to the connection before the handshake completes.

## Fix

- Upgrade `rustls` to `0.23.46` or later on the 0.23 line.
- Upgrade `rustls` to `0.24.0-dev.2` or later if you use the 0.24 development line.

## Timeline

- 2026-10-27T16:10:07+00:00 ghsa https://github.com/advisories/GHSA-vp88-798v-h67f

## From the sources

In rustls 0.23.44 and 0.23.45, application data that a client buffers before the handshake completes is sent to the server even when the server rejects Encrypted Client Hello (ECH).

When the server rejects ECH, the client completes the handshake with the outer ClientHello and authenticates the server against the ECH config's `public_name`. At the end of the handshake, `start_traffic()` encrypts and queues any plaintext buffered by `ClientConnection::writer()`. It does this *before* checking for `EchStatus::Rejected` and queueing the `ech_required` alert.

The application then receives `Error::PeerIncompatible(ServerRejectedEncryptedClientHello)`, as expected. However, the client is still expected to call `write_tls()` to send the fatal alert, and that call also sends the encrypted application data. The server decrypts the data and only then receives the alert.

The ordering bug is older than 0.23.44. Before 0.23.44, the client checked the server certificate against the inner server name rather than `public_name`, so a correctly configured server failed certificate verification first and no data was sent. 0.23.44 fixed that check, which makes the ordinary rejection path reachable.

# Impact

Plaintext meant for the inner server, the one named in the encrypted ClientHello, goes to the client-facing server identified by `public_name`. That server is properly authenticated, so this is not an attack by an unauthenticated party. However this violates [RFC 9849](https://www.rfc-editor.org/info/rfc9849), which says the following:

- Section 6.1.6: if the handshake and authentication succeed after ECH rejection, the client "MUST ... abort the connection with an "ech_required" alert **before sending any application data to the server.**"
- Section 6.1.7: the certificate is checked only against `public_name`, and the connection "MUST NOT" be reported as successful to the application. rustls does report failure correctly. The problem is only that data is sent before the alert.

This affects only clients that meet all of these conditions:

- They use `EchMode::Enable`. GREASE ECH is not affected.
- They write application data before the handshake completes.
- They connect to a server that rejects their ECH config, for example because the config is stale. This is the same case where the server returns retry configs.

The usual client response to rejection is to retry with the server's retry configs. In that case, the data has already gone to the outer server.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
