From f399b01dc4dbb47f678301aea6f476527889b959 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 10 Oct 2018 20:23:48 +0200 Subject: dns: use IDNA 2008 to encode non-ascii hostnames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, Node.js left it up to the system resolver or c-ares. Leaving it to the system resolver introduces platform differences because: * some support IDNA 2008 * some only IDNA 2003 (glibc until 2.28), and * some don't support IDNA at all (musl libc) c-ares doesn't support IDNA either although curl does, by virtue of linking against libidn2. Upgrading from libidn1 to libidn2 in order to get proper IDNA 2008 support was the fix for curl's CVE-2016-8625. libidn2 is not an option (incompatible license) but ICU has an IDNA API and we already use that in one place. For non-ICU builds, we fall back to the bundled punycode.js that also supports IDNA 2008. Fixes: https://github.com/nodejs-private/security/issues/97 Fixes: https://github.com/nodejs/node/issues/25558 PR-URL: https://github.com/nodejs/node/pull/25679 Reviewed-By: Santiago Gimeno Reviewed-By: Saúl Ibarra Corretgé Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Tiancheng "Timothy" Gu --- node.gyp | 1 + 1 file changed, 1 insertion(+) (limited to 'node.gyp') diff --git a/node.gyp b/node.gyp index d762b8c301..0089b0a850 100644 --- a/node.gyp +++ b/node.gyp @@ -126,6 +126,7 @@ 'lib/internal/fs/utils.js', 'lib/internal/fs/watchers.js', 'lib/internal/http.js', + 'lib/internal/idna.js', 'lib/internal/inspector_async_hook.js', 'lib/internal/js_stream_socket.js', 'lib/internal/linkedlist.js', -- cgit v1.2.3