tls: fix case-sensitive SNI context matching · nodejs/node@31beb4f · GitHub
Skip to content

Commit 31beb4f

Browse files
mcollinaaduh95
authored andcommitted
tls: fix case-sensitive SNI context matching
The regex constructed by server.addContext() lacked the case-insensitive flag, causing uppercase or mixed-case SNI hostnames from ClientHello to miss their intended context and fall back to the default context. This violates RFC 6066 Section 3, which states that DNS hostnames are case-insensitive. In mTLS configurations with per-tenant contexts, this allowed bypassing client certificate authorization by simply uppercasing the SNI hostname. Add the 'i' flag to the RegExp in addContext() so that SNI matching is case-insensitive. PR-URL: nodejs-private/node-private#857 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> CVE-ID: CVE-2026-48928 Refs: https://hackerone.com/reports/3656869
1 parent cc7c11b commit 31beb4f

2 files changed

Lines changed: 80 additions & 1 deletion

File tree

lib/internal/tls/wrap.js

Lines changed: 1 addition & 1 deletion
Lines changed: 79 additions & 0 deletions

0 commit comments

Comments
 (0)