Skip to content

GHSA-2mjx-qc3c-rqvc RUSTSEC-2026-0285

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

Medium crates.io
Severity
5.3 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
—
No score published
Known exploited
No
Not in CISA's catalog
Weakness
—
Not classified
Fix
0.23.45
Upgrade rustls to this version or later

Description

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.

Affected versions

crates.io

PackageVulnerableFixed in
rustls
>= 0.23.13, < 0.23.45
0.23.45

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

rustls crates.io → 0.23.45

cargo
cargo update -p rustls --precise 0.23.45

Severity breakdown

CVSS 3.1 5.3

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

References

Timeline

  1. Published
  2. Last updated by the source
AdvisorySeverityWhy it's related
GHSA-vp88-798v-h67f
rustls: ECH rejection can expose buffered application data to authenticated outer server before `ech_required` alert
Low Also affects rustls
GHSA-w44r-93j7-qv28
rustls: An unauthenticated ServerHello poisons the per-name key-exchange record, so later ClientHellos carry only a classical X25519 share
Low Also affects rustls
GHSA-h2v8-394m-p7vv
Rustls: Brotli certificate decompression can allocate an attacker-controlled amount of memory up to 1 GiB before authentication.
Low Also affects rustls
GHSA-c8m5-c952-6cm4
Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKs
Medium Also affects rustls
GHSA-qg5g-gv98-5ffh
rustls network-reachable panic in `Acceptor::accept`
High Also affects rustls
GHSA-6g7w-8wpp-frhj
Denial of Service Vulnerability in Rustls Library
High Also affects rustls
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor