mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
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
Internal Modules
The modules located in lib/internal directory are exclusively meant
for internal usage within the Node.js core. They are not intended to
be accessed via user modules require(). These modules may change at
any point in time. Relying on these internal modules outside the core
is not supported and can lead to unpredictable behavior.
In certain scenarios, accessing these internal modules for debugging or
experimental purposes might be necessary. Node.js provides the --expose-internals
flag to expose these modules to userland code. This flag only exists to
assist Node.js maintainers with debugging internals. It is not meant for
use outside the project.