---
id: "GHSA-2mjx-qc3c-rqvc"
kind: "vulnerability"
aliases: ["GHSA-2mjx-qc3c-rqvc"]
title: "Rustls: TLS 1.3 handshake messages incorrectly accepted across encryption level boundaries"
severity: "medium"
cvss: 5.3
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "rustls", "fixed": ["0.23.45"], "affected": ">= 0.23.13, < 0.23.45", "ecosystem": "cargo"}]
ecosystems: ["cargo"]
tags: ["cargo", "package", "rust", "rustls"]
not_affected_if: ["default-config"]
published_at: "2026-10-05T23:30:17+00:00"
first_seen_at: "2026-10-27T15:18:30+00:00"
updated_at: "2026-10-27T15:18:56+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-2mjx-qc3c-rqvc", "first_seen_at": "2026-10-27T15:18:30+00:00"}]
---

# Rustls: TLS 1.3 handshake messages incorrectly accepted across encryption level boundaries

Rustls accepted TLS 1.3 handshake messages sent in plaintext when they followed a key-changing message in the same record, violating RFC 8446. A network-position attacker can inject plaintext handshake messages that rustls accepts, though the authenticated transcript still prevents altering or completing a handshake.

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

## Affected

- cargo:rustls affected >= 0.23.13, < 0.23.45 fixed 0.23.45

## How to check

- Run `cargo tree -i rustls` in the project to find the resolved rustls version.
- Check `Cargo.lock` for the `rustls` entry and confirm whether it is `0.23.13` through `0.23.44`.

## Fix

- Upgrade the `rustls` crate to `0.23.45` or later and rebuild.
- Run `cargo update -p rustls` if the version is pinned in `Cargo.lock`.

## Timeline

- 2026-10-27T15:18:30+00:00 ghsa https://github.com/advisories/GHSA-2mjx-qc3c-rqvc

## From the sources

Rustls accepted TLS 1.3 handshake messages sent at the wrong encryption level when they followed a key-changing message in the same record. The handshake transcript is still authenticated, so a network-position attacker cannot use this to alter or complete a handshake; the practical effect is that a peer could send handshake messages that should be encrypted in plaintext without rustls rejecting the connection.

This issue affects rustls versions 0.23.13 through 0.23.44 inclusive.

# Original report
### Summary
Rustls (tested version 0.23.44, and it appears still an issue on latest master though I have not tested this) accepts a TLS 1.3 server flight where a plaintext EncryptedExtensions is packed into the same record as the ServerHello.

This is very similar to Go's CVE-2025-61730 fixed in https://github.com/golang/go/commit/5046bdf8a612b35a2c1a9e168054c1d5c65e7dd7

### Details
It appears `Deframer::aligned` considers itself aligned as long as all messages remaining in the buffer are complete. Rustls processes the ServerHello, installs the handshake keys, then pulls the complete (plaintext) EncryptedExtensions out of the buffer.

This is insufficient per RFC 8446 section 5.1's

> Handshake messages MUST NOT span key changes.  Implementations MUST verify that all messages immediately preceding a key change align with a record boundary; if not, then they MUST terminate the connection with an "unexpected_message" alert.  Because the ClientHello, EndOfEarlyData, ServerHello, Finished, and KeyUpdate messages can immediately precede a key change, implementations MUST send these messages in alignment with a record boundary.

### Impact
An on path attacker can inject plaintext messages that are accepted.

### Tool Use Disclosure
This was discovered by a new TLS/DTLS test suite currently under construction. The specific testcase was inspired by the Go CVE. Other tested implementations (Botan, OpenSSL, BoringSSL, Go, wolfSSL) reject this protocol flow. Daybreak Blue reviewed the rustls code to identify probable root cause.

---

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