Repository navigation
Hardened hostname handling against Node.js October 2026 security release - #34
Open
Gera-G-Guiles wants to merge 2 commits into
Open
Gera-G-Guiles wants to merge 2 commits into
Gera-G-Guiles wants to merge 2 commits into
Conversation
Node.js published security releases on 2026-10-21 (22.23.4, 24.22.1, 26.12.1). Several of the fixed issues depend on how a hostname is written before it reaches the DNS resolver or the TLS identity check. Total.js cannot require a specific Node.js version, so the framework now normalizes and validates hostnames itself, whatever Node.js version the user runs. Related advisories: - CVE-2026-105482 (high): dns.resolve*() truncates names at a NUL byte, so "attacker.example\0.trusted.example" can pass a hostname validation and then resolve a different name. - CVE-2026-105483 (high), CVE-2026-106069 (high), CVE-2026-106072 (medium): tls.checkServerIdentity() mishandles IPv4 literals written with non-ASCII digits, leading zeros (octal vs decimal) or non-canonical forms (0x7f.0.0.1, 127.1, 2130706433), so a certificate can match a different address than the one the OS connects to. Changes: - utils.js: added U.validhost(host). It accepts plain hostnames and canonical IP literals only and rejects NUL bytes, non-ASCII characters and non-canonical IPv4 forms. - utils.js: added U.tohost(host). It converts the host to its canonical ASCII form with url.domainToASCII (punycode for international names, dotted IPv4 for numeric forms) and returns an empty string when the host is invalid. Valid input keeps working: only the written form is normalized. - utils.js: U.resolve() (used by REQUEST) rejects invalid hostnames before resolving. parseURI() already normalizes URLs, so this is defense in depth. - utils.js: U.connect() normalizes opt.host and returns an "Invalid hostname" error instead of connecting when the host is not valid. - mail.js: the SMTP server is normalized with U.tohost() on a copy of the options (the user's object is not modified). Invalid values return "Invalid SMTP server hostname." instead of reaching the socket. Not covered by the framework (fixed only by updating Node.js): - CVE-2026-105481 (medium): unsolicited data on a reused keep-alive socket. - The Brotli decoder issue (CVE-2026-111497) does not apply, the framework only decompresses gzip and deflate. The WebSocket client and the HTTPS proxy take their hosts from parseURI(), so they already receive normalized values.
Documents the hostname normalization and validation (U.validhost, U.tohost, U.resolve, U.connect, SMTP server) and the Node.js CVEs it covers (CVE-2026-105482, CVE-2026-105483, CVE-2026-106069, CVE-2026-106072). Notes that CVE-2026-105481 is fixed only by updating Node.js and that CVE-2026-111497 does not affect the framework.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.