node/lib/internal/tls
Matteo Collina 91b970886f
tls: wrap SNICallback invocation in try/catch
Wrap the owner._SNICallback() invocation in loadSNI() with try/catch
to route exceptions through owner.destroy() instead of letting them
become uncaught exceptions. This completes the fix from CVE-2026-21637
which added try/catch protection to callALPNCallback,
onPskServerCallback, and onPskClientCallback but missed loadSNI().

Without this fix, a remote unauthenticated attacker can crash any
Node.js TLS server whose SNICallback may throw on unexpected input
by sending a single TLS ClientHello with a crafted server_name value.

Fixes: https://hackerone.com/reports/3556769
Refs: https://hackerone.com/reports/3473882
CVE-ID: CVE-2026-21637

PR-URL: https://github.com/nodejs-private/node-private/pull/819
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
CVE-ID: CVE-2026-21637
2026-03-22 17:04:52 +01:00
..
common.js lib: backport _tls_common and _tls_wrap refactors 2026-03-16 17:29:52 +01:00
secure-context.js tls: add allowPartialTrustChain flag 2024-09-12 11:06:49 +02:00
secure-pair.js tools: add lint rule to keep primordials in ASCII order 2024-04-29 22:46:28 +02:00
wrap.js tls: wrap SNICallback invocation in try/catch 2026-03-22 17:04:52 +01:00