Skip to content

Commit 26079c0

Browse files
authored
doc: clarify proxy threat model
Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #64366 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
1 parent 116302d commit 26079c0

4 files changed

Lines changed: 62 additions & 4 deletions

File tree

SECURITY.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,16 @@ then untrusted input must not lead to arbitrary JavaScript code execution.
221221
* The developers and infrastructure that run it.
222222
* The operating system that Node.js is running under and its configuration,
223223
along with anything under the control of the operating system.
224+
* The deployment network environment for the privacy of traffic and routing
225+
decisions, including internal networks through which Node.js traffic passes
226+
and configured HTTP(S) proxy servers. Built-in proxy support is intended to
227+
route traffic through proxies authorized for the deployment, often because a
228+
firewall requires one to access external networks. It is not intended to hide
229+
traffic from network operators or authorities governing the deployment.
230+
Untrusted or unauthorized proxies, as well as deployment policy or legal
231+
compliance controls around proxy use, are the responsibility of the deployment
232+
operator and are outside this threat model. This does not change that data
233+
parsed from network protocol peers is untrusted as described above.
224234
* The code it is asked to run, including JavaScript, WASM and native code, even
225235
if said code is dynamically loaded, e.g., all dependencies installed from the
226236
npm registry or libraries loaded via `node:ffi`.
@@ -301,6 +311,19 @@ the community they pose.
301311
client consuming unsolicited or misordered responses within the same HTTP/1.1 connection
302312
reuse lifecycle are generally not considered Node.js vulnerabilities.
303313

314+
#### Unauthorized or untrusted HTTP proxy deployments
315+
316+
* Built-in HTTP proxy support is intended for routing outbound requests through
317+
a proxy authorized by the deployment, for example because a firewall requires
318+
one to reach external networks. It is not an anonymity, traffic-hiding, or
319+
policy-evasion feature.
320+
* Reports that depend on using an unauthorized proxy, expecting Node.js to
321+
provide privacy from a configured proxy or internal network, or expecting
322+
Node.js to enforce deployment-specific network policy or legal requirements
323+
are not considered Node.js vulnerabilities. Deployment operators are
324+
responsible for hardening such environments and controlling which proxy
325+
settings are allowed.
326+
304327
#### Malicious Third-Party Modules (CWE-1357)
305328

306329
* Code is trusted by Node.js. Therefore any scenario that requires a malicious

doc/api/cli.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,9 +3411,14 @@ added:
34113411
> Stability: 1.1 - Active Development
34123412
34133413
When enabled, Node.js parses the `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY`
3414-
environment variables during startup, and tunnels requests over the
3414+
environment variables during startup, and routes requests through the
34153415
specified proxy.
34163416

3417+
Use this only with proxies that are trusted and authorized for the deployment.
3418+
Proxy support is intended for reaching external networks through authorized
3419+
proxy servers, for example when a firewall requires one. It is not for hiding
3420+
traffic or evading network policy. See [Built-in Proxy Support][].
3421+
34173422
This is equivalent to setting the [`NODE_USE_ENV_PROXY=1`][] environment variable.
34183423
When both are set, `--use-env-proxy` takes precedence.
34193424

@@ -4097,9 +4102,14 @@ added:
40974102
> Stability: 1.1 - Active Development
40984103
40994104
When enabled, Node.js parses the `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY`
4100-
environment variables during startup, and tunnels requests over the
4105+
environment variables during startup, and routes requests through the
41014106
specified proxy.
41024107

4108+
Use this only with proxies that are trusted and authorized for the deployment.
4109+
Proxy support is intended for reaching external networks through authorized
4110+
proxy servers, for example when a firewall requires one. It is not for hiding
4111+
traffic or evading network policy. See [Built-in Proxy Support][].
4112+
41034113
This can also be enabled using the [`--use-env-proxy`][] command-line flag.
41044114
When both are set, `--use-env-proxy` takes precedence.
41054115

@@ -4405,6 +4415,7 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
44054415
<!-- v8-options end -->
44064416

44074417
[#42511]: https://github.com/nodejs/node/issues/42511
4418+
[Built-in Proxy Support]: http.md#built-in-proxy-support
44084419
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
44094420
[Chromium's policy for locally trusted certificates]: https://chromium.googlesource.com/chromium/src/+/main/net/data/ssl/chrome_root_store/faq.md#does-the-chrome-certificate-verifier-consider-local-trust-decisions
44104421
[CommonJS module]: modules.md

doc/api/http.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4573,6 +4573,22 @@ support.
45734573
45744574
If the request is made to a Unix domain socket, the proxy settings will be ignored.
45754575
4576+
### Proxy security considerations
4577+
4578+
Built-in proxy support routes outbound requests through an HTTP(S) proxy, often
4579+
because a firewall requires one to access external networks. It is not an
4580+
anonymity or traffic-hiding feature and does not attempt to hide traffic from
4581+
the proxy, the local network, network operators, or authorities that govern the
4582+
deployment.
4583+
4584+
Configure only proxies that are trusted and authorized for the deployment. A
4585+
proxy can observe connection metadata; for plain HTTP requests, or when TLS is
4586+
terminated or intercepted by the proxy, it can also observe request and response
4587+
contents. Node.js does not support treating an untrusted proxy as a privacy
4588+
boundary. Deployment operators are responsible for controlling proxy
4589+
configuration and for meeting deployment-specific network policy and legal
4590+
requirements.
4591+
45764592
### Proxy URL Format
45774593
45784594
Proxy URLs can use either HTTP or HTTPS protocols:

doc/node.1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,8 +1652,12 @@ See \fBSSL_CERT_DIR\fR and \fBSSL_CERT_FILE\fR.
16521652
.
16531653
.It Fl -use-env-proxy
16541654
When enabled, Node.js parses the \fBHTTP_PROXY\fR, \fBHTTPS_PROXY\fR and \fBNO_PROXY\fR
1655-
environment variables during startup, and tunnels requests over the
1655+
environment variables during startup, and routes requests through the
16561656
specified proxy.
1657+
Use this only with proxies that are trusted and authorized for the deployment.
1658+
Proxy support is intended for reaching external networks through authorized
1659+
proxy servers, for example when a firewall requires one. It is not for hiding
1660+
traffic or evading network policy. See Built-in Proxy Support.
16571661
This is equivalent to setting the \fBNODE_USE_ENV_PROXY=1\fR environment variable.
16581662
When both are set, \fB--use-env-proxy\fR takes precedence.
16591663
.
@@ -2316,8 +2320,12 @@ variable is strongly discouraged.
23162320
.It Ev NODE_USE_ENV_PROXY Ar 1
23172321

23182322
When enabled, Node.js parses the \fBHTTP_PROXY\fR, \fBHTTPS_PROXY\fR and \fBNO_PROXY\fR
2319-
environment variables during startup, and tunnels requests over the
2323+
environment variables during startup, and routes requests through the
23202324
specified proxy.
2325+
Use this only with proxies that are trusted and authorized for the deployment.
2326+
Proxy support is intended for reaching external networks through authorized
2327+
proxy servers, for example when a firewall requires one. It is not for hiding
2328+
traffic or evading network policy. See Built-in Proxy Support.
23212329
This can also be enabled using the \fB--use-env-proxy\fR command-line flag.
23222330
When both are set, \fB--use-env-proxy\fR takes precedence.
23232331
.

0 commit comments

Comments
 (0)