A Handshake That Never Met a Certificate: CVE-2026-124286 in Erlang/OTP's TLS Client
This is the English adaptation of the original Korean analysis at dohyeontech.github.io. On 24 November 2026 the Erlang/OTP team published GHSA-7mff-v332-665j: "TLS 1.2 Client Completes Handshake Without a Server Certif
This is the English adaptation of the original Korean analysis at dohyeontech.github.io.
On 24 November 2026 the Erlang/OTP team published GHSA-7mff-v332-665j: "TLS 1.2 Client Completes Handshake Without a Server Certificate." CVE-2026-124286, CVSS 4.0 base 9.1, CWE-347 (Improper Verification of Cryptographic Signature). The reporter was Philip Calvin.
Read that title once more. The client is configured with verify_peer and a CA store. The server sends no Certificate message at all. The handshake finishes anyway, ssl:connect/3 returns {ok, Socket}, and every byte the application writes afterwards is readable by the party on the other end.
What makes this worse than a usual authentication bypass is that nothing broke. There was no crash, no unexpected alert, no log line about a missing certificate. The client believed it had validated the chain, consulted the trust store and matched the hostname. It had done none of the three, because none of the three ever ran.
The blast radius is every BEAM process that dials out over TLS 1.2. On Hex.pm the cumulative downloads of the mainstream Elixir HTTP clients β hackney 175.6M, tesla 76.2M, mint 71.9M, finch 66.3M, req 21.0M, queried 1 December 2026 β all sit on :ssl. So do :httpc, the AMQP/MQTT/Postgres drivers, and most vendor SDKs.
And the usual framing of "requires an on-path attacker" undersells it. If the application connects to a URL that an attacker can supply β a customer-configured webhook, a plugin manifest, a callback endpoint, a tenancy-supplied base URL β no interception is needed. The attacker runs the endpoint, sends no certificate, and the client reports success. Teams that enabled verify_peer precisely so that attacker-controlled endpoints could not silently receive credentials had that assumption removed.
What is actually affected
| Protocol | TLS 1.2 and DTLS 1.2 clients. TLS 1.3 is unaffected. Servers are unaffected |
| Key exchanges |
ecdhe_rsa, ecdhe_ecdsa, dhe_rsa, dhe_dss β anything that uses a ServerKeyExchange
|
| Not affected |
rsa (static RSA transport), ecdh_rsa, ecdh_ecdsa β no ServerKeyExchange to forge |
| Fixed in | OTP 27.3.4.14, 28.5.0.9, 29.0.3 (ssl 11.2.12.10, 11.6.0.8, 11.7.3) |
| Exploitation in the wild | None reported. Not in CISA KEV. No weaponised public tooling observed |
The DTLS half is the part most write-ups omit. dtls_client_connection.erl reaches the same certify state and the same ssl_handshake decoder, so DTLS 1.2 clients riding the same code path are in scope.
1. The decoder default, 2012
ssl_handshake:decode_server_key/3 takes the ServerKeyExchange body and splits it into key-exchange parameters plus a signature. dec_server_key_params/3 hands the remainder to dec_server_key_signature/3, which in the vulnerable code ended like this (lib/ssl/src/ssl_handshake.erl, maint-28 at 4d8d3ed):
dec_server_key_signature(Params, <<>>, _) ->
{Params, {null, anon}, <<>>};
dec_server_key_signature(Params, <<?UINT16(0)>>, _) ->
{Params, {null, anon}, <<>>};
dec_server_key_signature(Params, <<?UINT16(Len), Signature:Len/binary>>, _) ->
{Params, undefined, Signature};
dec_server_key_signature(_, _, _) ->
throw(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE, failed_to_decrypt_server_key_sign)).
An absent signature field and a zero-length signature both decode to "anonymous". Neither clause consults the key exchange. ecdhe_rsa, ecdhe_ecdsa, dhe_rsa and dhe_dss all pass through here.
These clauses date to commit 938a524, dated 2012-09-20, "SSL: simplify server key encoding, decoding and signature handling". Before that commit the decoder was limited to Diffie-Hellman keys; the refactor unified the path for every key exchange and, with it, made "no signature" a legal input for suites that require one. The CNA record lists 938a524 as the introducing commit, which is why the affected range nominally starts at OTP 17.0: anything older is simply not comparable under the current version scheme.
2. The clause that answered true
The client-side certify state handles the message at tls_dtls_client_connection.erl:207:
Params = ssl_handshake:decode_server_key(Keys, KexAlg, ...),
HashSign = tls_dtls_gen_connection:negotiated_hashsign(
Params#server_key_params.hashsign, KexAlg, PubKeyInfo, ...),
case tls_dtls_gen_connection:is_anonymous(KexAlg) of
true -> calculate_secret(...);
false -> case ssl_handshake:verify_server_key(Params, HashSign, ...) of
true -> calculate_secret(...);
false -> throw(?ALERT_REC(?FATAL, ?DECRYPT_ERROR))
end
end;
is_anonymous/1 returns true only for dh_anon, ecdh_anon, psk, dhe_psk, ecdhe_psk, rsa_psk and srp_anon. An ECDHE_RSA suite takes the false branch, which is correct β it must verify a signature. negotiated_hashsign/4 then adopts {null, anon} verbatim because its second clause accepts any {_, _} tuple, and verify_server_key/5 builds the hash and calls verify_signature/5.
The key material is missing. Since no Certificate message arrived, handshake_env.public_key_info is still undefined β its default in ssl_connection.hrl:96. Among the verify_signature/5 clauses there was exactly one that would accept that:
verify_signature(Version, _Msg, {_HashAlgo, anon}, _Signature, _)
when ?TLS_1_X(Version), ?TLS_LTE(Version, ?TLS_1_2) ->
true;
No message, no signature, no key. If the negotiated signature algorithm is anon, the answer is true.
The broken invariant can be stated in one sentence: in a suite that requires server authentication, "the signature verified" must mean "a public key taken from a validated certificate verified a signature." Here the code took a decision from two disagreeing sources β the suite name says authentication is required, the message body says it is anonymous β and let the message win without any rule that says it must not.
Why this looked like dead code
ssl_cipher.erl:352 documents the anonymous suites as "only supported if explicitly set by user. Intended only for testing." They are not in the default suite list. So a clause that accepts {null, anon} looks unreachable in production, and reviewers would reasonably skip it.
The clause was in fact never used even by real anonymous suites. Look again at the branch above: when is_anonymous(KexAlg) is true, verify_server_key/5 is never called. The true clause existed to serve anonymous suites and was unreachable from them. Its only reachable path was a message that claimed an anonymous signature under an authenticated suite β precisely the attack.
This is also the likely reason the June commit under-scoped the problem. That commit removed the clauses and its message reads "Only possibly affects legacy DHE_DSS" β the assumption being that unsigned ServerKeyExchange only came from old DHE_DSS devices in the field. Five months later it turned out that the most common ECDHE suite in the ecosystem was equally reachable.
3. The wire
The attacker answers a ClientHello with TLS 1.2:
| # | Message | Content |
|---|---|---|
| 1 | ServerHello | TLS 1.2, a suite the client offered (e.g. TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256), empty session ID |
| 2 | β | No Certificate message |
| 3 | ServerKeyExchange |
named_curve (3), curve 0x001D (x25519), one-byte length 32, 32-byte public point, then nothing |
| 4 | ServerHelloDone | empty |
Then, inside the client:
-
certifyreceives#server_key_exchange{}.public_key_infois stillundefined. -
dec_server_key_signature/3returns{Params, {null, anon}, <<>>}. -
negotiated_hashsign/4accepts{null, anon}as the negotiated algorithm; the missing public key is never inspected. -
is_anonymous(ecdhe_rsa)is false, soverify_server_key/5runs. -
verify_signature/5matches theanonclause and returnstrue. - The client derives the premaster secret from the attacker's ECDH point and computes the master secret and traffic keys. The attacker holds the matching private key and computes the same.
- The client sends
ClientKeyExchange,ChangeCipherSpec,Finished.ssl:connect/3returns{ok, Socket}.
At that point ssl:peercert/1 returns {error, no_peercert} β the absence is observable, but only after the connection is established. That asymmetry defines the operational character of this bug: the missing certificate does not stop the connection, it only leaves a trace.
The CNA's reproduction steps describe exactly this, and note that BoringSSL's BoGo test runner already contains a matching server behaviour under the name UnauthenticatedECDH. Other TLS stacks had the test case; OTP did not, until 13 November.
Forward secrecy is not a defence here. The ephemeral key belongs to the attacker, so the session keys were never secret.
4. The patch
Commit 74782af (13 November 2026) is lib/ssl/src/ssl_handshake.erl, +1/β6, in two hunks.
-verify_signature(Version, _Msg, {_HashAlgo, anon}, _Signature, _)
- when ?TLS_1_X(Version), ?TLS_LTE(Version, ?TLS_1_2) ->
- true;
The only path that returned true without a public key is gone. Real anonymous suites are unaffected because they never call the verification function.
-dec_server_key_signature(Params, <<>>, _) ->
- {Params, {null, anon}, <<>>};
-dec_server_key_signature(Params, <<?UINT16(0)>>, _) ->
+dec_server_key_signature(Params, <<>>, Version) when ?TLS_LTE(Version, ?TLS_1_2) ->
{Params, {null, anon}, <<>>};
The empty-remainder case is now restricted to TLS 1.2 and below, and the zero-length-signature case no longer maps to "anonymous". Both doors from "no signature" to "anonymous" are shut; what remains is a path that can only be walked by a suite that never asked for authentication.
Two tests came with it. tls_api_SUITE:tls_reject_unauthenticated_ecdhe_rsa opens a raw TCP listener, forges the server flight by hand in two variants β an absent signature, and an explicit {sha256, anonymous} algorithm with a zero-length signature β and asserts the client's behaviour, not just its return value. The test's own documentation states the contract:
it must not send ClientKeyExchange, as that would complete the handshake without any server authentication, bypassing verify_peer, the trust store and hostname checking.
That phrasing matters. Some implementations fail verification, log it, and continue. Pinning the contract at "the client does not produce the message that would advance the handshake" is the right granularity, and it is why the same test also passes on the variant where the alert code differs.
5. The branch that skipped a fix
The interesting part of this story is not that a 14-year-old decoder default existed. It is that the fix shipped in July for two release tracks and in November for the third.
-
2026-06-09 β
d9a9319, "ssl: Make anonymous handling stricter", lands on maint-27 and through it on maint (29) under ticket OTP-20190. Message: "Only possibly affects legacy DHE_DSS." - 2026-07-02 β OTP 29.0.3 (ssl 11.7.3) and OTP 27.3.4.14 (ssl 11.2.12.10) ship, both containing it.
-
2026-11-13 β
74782afis committed as a backport. Its message is blunt: "Backport to maint-28 of the anonymous-handling hardening that reached maint-27 and maint-29 via OTP-20190 but was missed on maint-28." - 2026-11-23 β OTP 28.5.0.9 (ssl 11.6.0.8) is tagged. Its release note says the commit "should have been included in OTP-28.5.0.3" and that the issue "turned out to have more serious consequences than in the scenario that we considered when doing the hardening."
- 2026-11-24 β the advisory and the CVE record.
For five months, operators on the OTP 28 line had every reason to believe they were patched. Nothing told them otherwise, because nothing tested it. The June commit changed source only; no case asserted that a client offering ECDHE_RSA rejects a server that sends no certificate. Had that test existed in June, the missing maint-28 backport would have failed CI on the first merge.
One more context line: over the past year The Hacker News counts four critical Erlang/OTP flaws addressed β CVE-2025-32433 (10.0), CVE-2022-37026 (9.8), CVE-2026-55953 (9.1), CVE-2026-89422 (9.3) β and this is a fifth. CVE-2025-32433 was exploited in the wild within days of disclosure to deploy reverse shells. "BEAM is quiet infrastructure" is no longer a safe assumption; OTP patch levels deserve the same review cadence as application dependencies.
6. If you run this stack
Check the runtime first:
erl -noshell -eval 'io:format("~s~n",[erlang:system_info(otp_release)]),halt().'
Below 27.3.4.14, 28.5.0.9 or 29.0.3, upgrade this week. For OTP 26 and earlier there is no fixed release at all; either move tracks or backport 74782af, which is one file and six deleted lines.
Until then, in order of preference:
-
TLS 1.3 only β
{versions, ['tlsv1.3']}. The cleanest cut, if your peers support it. -
Static RSA transport only β the advisory's last resort. No
ServerKeyExchange, therefore no unsigned-SKX bypass:
RsaOnly = ssl:filter_cipher_suites(
ssl:cipher_suites(all, 'tlsv1.2'),
[{key_exchange, fun(rsa) -> true; (_) -> false end}]),
Opts = [{verify, verify_peer},
{cacerts, public_key:cacerts_get()},
{versions, ['tlsv1.2']},
{ciphers, RsaOnly},
{server_name_indication, "api.example.com"},
{customize_hostname_check,
[{match_fun, public_key:pkix_verify_hostname_match_fun(https)}]}].
The advisory discourages this itself: static RSA gives up forward secrecy and many servers no longer accept it, so handshakes simply fail.
-
Certificate pinning is not a substitute.
verify_funnever runs here β there is no certificate to run it against. A team that pinned a key and assumed the pinning was the backstop had no backstop.
For detection on a still-unpatched runtime, assert the invariant at the call site:
{ok, Sock} = ssl:connect(Host, Port, Opts, 5000),
case ssl:peercert(Sock) of
{ok, _Der} -> ok;
{error, no_peercert} ->
logger:error("TLS session completed without a peer certificate: ~p", [Host]),
ssl:close(Sock)
end.
On a patched release this branch is unreachable. On an unpatched one it is the cheapest safety net you can deploy today: it converts an invisible success into a visible failure. Collecting ssl:connection_information(Sock, [protocol, selected_cipher_suite, peer_certificate]) per session gives the same signal with more context, and shows you how much of your fleet is still negotiating TLS 1.2.
On the network side, the signature is a TLS 1.2 handshake that carries ServerKeyExchange without a preceding Certificate. A genuine server that selected an authenticated suite always sends the certificate. Blocking TLS 1.2 outright, where you can, removes the attack surface entirely.
Original (Korean): μΈμ¦μλ₯Ό 보λ΄μ§ μμ μλ²κ° 'μΈμ¦λ¨'μΌλ‘ λλ¬λ€ β Erlang/OTP TLS 1.2
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.