Files
node/test/client-proxy
Matteo Collina d14db811c7 http: redact proxy credentials in invalid proxy URL errors
The earlier fix to redact proxy credentials only covered the tunnel
error and the ProxyConfig.href property. Four other error paths still
interpolate the raw proxy URL, credentials included, into
ERR_PROXY_INVALID_CONFIG messages:

* lib/internal/http.js - ProxyConfig constructor when new URL() fails.
* lib/internal/http.js - parseProxyUrl when the URL contains CR or LF.
* lib/http.js - setGlobalProxyFromEnv() with an unparseable http_proxy.
* lib/http.js - setGlobalProxyFromEnv() with an unparseable https_proxy

Add a redactProxyUrl() helper that strips userinfo when parsing
succeeds and falls back to a textual strip for the unparseable cases
that reach the vulnerable paths, then route all four sites through it.

Refs: https://hackerone.com/reports/3966924
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/1001
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
CVE-ID: CVE-2026-123871
2026-11-07 12:48:11 +01:00
..