Am I affected?

type your erlang.org/otp version to check

Description

Key Exchange without Entity Authentication vulnerability in Erlang/OTP ssl allows a peer that answers a TLS 1.3 client connection to impersonate the intended server. A pre_shared_key extension in the ServerHello that the client never offered causes the client to complete the handshake without validating the server's certificate, so ssl:connect returns {ok, Socket} against a peer holding no certificate, no private key and no prior session.

tls_client_connection_1_3:handle_server_hello/2 passes the received extension to tls_gen_connection_1_3:handle_resumption/2, which sets resumption = true on its mere presence without checking that the client offered a PSK. tls_handshake_1_3:get_pre_shared_key/4 meanwhile falls back to the all-zero "no PSK" value and keys the handshake with the ordinary non-PSK schedule, so the attacker's own ephemeral key suffices. The resumption flag then routes maybe_resumption/1 straight to wait_finished, skipping the certificate-handling states, so certificate path validation, verify_fun, hostname verification, partial_chain, CRL checking and OCSP stapling are all bypassed. The default client configuration is affected; clients restricted to TLS 1.2 are not.

This issue affects OTP from OTP 22.2 before OTP 27.3.4.18, OTP 28.5.0.7, and OTP 29.1.1, corresponding to ssl from 9.5 before 11.2.12.13, 11.6.0.6, and 11.7.7.

Weaknesses & attack patterns

Weakness

CWE-322 · Key Exchange without Entity Authentication in catalog → MITRE ↗

Attack patterns

CAPEC-94 · Adversary in the Middle (AiTM) MITRE ↗

An attacker that answers a TLS 1.3 client connection, either as the host the client dials or as an on-path attacker, completes the handshake as the intended server and holds all traffic keys. It can read everything the application sends, including credentials, tokens and request bodies, and forge every response. Any consumer of ssl:connect that negotiates TLS 1.3 is affected, including httpc over HTTPS, database and messaging client libraries, and TLS distribution clients.

Affected — Erlang

22.2 and up affected
27.3.4.18 not affected
28.5.0.7 not affected
29.1.1 not affected
every other version: unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules tls_client_connection_1_3 · tls_gen_connection_1_3 · tls_handshake_1_3
source files lib/ssl/src/tls_client_connection_1_3.erl · lib/ssl/src/tls_gen_connection_1_3.erl · lib/ssl/src/tls_handshake_1_3.erl
routines tls_client_connection_1_3:handle_server_hello/2 · tls_client_connection_1_3:handle_encrypted_extensions/2 · tls_client_connection_1_3:maybe_resumption/1 · tls_gen_connection_1_3:handle_resumption/2 · tls_handshake_1_3:get_pre_shared_key/4

Affected — Erlang / ssl Repository ↗

9.5 and up affected
11.2.12.13 not affected
11.6.0.6 not affected
11.7.7 not affected
every other version: unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules tls_client_connection_1_3 · tls_gen_connection_1_3 · tls_handshake_1_3
source files src/tls_client_connection_1_3.erl · src/tls_gen_connection_1_3.erl · src/tls_handshake_1_3.erl
routines tls_client_connection_1_3:handle_server_hello/2 · tls_client_connection_1_3:handle_encrypted_extensions/2 · tls_client_connection_1_3:maybe_resumption/1 · tls_gen_connection_1_3:handle_resumption/2 · tls_handshake_1_3:get_pre_shared_key/4

Affected — GitHub / erlang/otp Repository ↗

21b8a1b and up affected
afec515 not affected
98c66c8 not affected
fd1d9d0 not affected
every other version: unaffected
cpe cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:*
modules · source files · routines
modules tls_client_connection_1_3 · tls_gen_connection_1_3 · tls_handshake_1_3
source files lib/ssl/src/tls_client_connection_1_3.erl · lib/ssl/src/tls_gen_connection_1_3.erl · lib/ssl/src/tls_handshake_1_3.erl
routines tls_client_connection_1_3:handle_server_hello/2 · tls_client_connection_1_3:handle_encrypted_extensions/2 · tls_client_connection_1_3:maybe_resumption/1 · tls_gen_connection_1_3:handle_resumption/2 · tls_handshake_1_3:get_pre_shared_key/4

Workarounds

Restrict affected clients to TLS 1.2 by setting {versions, ['tlsv1.2']} in the client's ssl options. This avoids the vulnerable code path at the cost of losing TLS 1.3.

No configuration both keeps TLS 1.3 and mitigates the issue.

References

Credits

Milad Nasr / Anthropic Finder
Luna Tong / Anthropic Finder
Ingela Andin Remediation developer

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
« All CVEs