Skip to content

Commit 618b22c

Browse files
mcollinaaduh95
authored andcommitted
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 a9a06a6 commit 618b22c

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
@@ -3389,9 +3389,14 @@ added:
33893389
> Stability: 1.1 - Active Development
33903390
33913391
When enabled, Node.js parses the `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY`
3392-
environment variables during startup, and tunnels requests over the
3392+
environment variables during startup, and routes requests through the
33933393
specified proxy.
33943394

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

@@ -4072,9 +4077,14 @@ added:
40724077
> Stability: 1.1 - Active Development
40734078
40744079
When enabled, Node.js parses the `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY`
4075-
environment variables during startup, and tunnels requests over the
4080+
environment variables during startup, and routes requests through the
40764081
specified proxy.
40774082

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

@@ -4380,6 +4390,7 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
43804390
<!-- v8-options end -->
43814391

43824392
[#42511]: https://github.com/nodejs/node/issues/42511
4393+
[Built-in Proxy Support]: http.md#built-in-proxy-support
43834394
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
43844395
[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
43854396
[CommonJS module]: modules.md

doc/api/http.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4553,6 +4553,22 @@ support.
45534553
45544554
If the request is made to a Unix domain socket, the proxy settings will be ignored.
45554555
4556+
### Proxy security considerations
4557+
4558+
Built-in proxy support routes outbound requests through an HTTP(S) proxy, often
4559+
because a firewall requires one to access external networks. It is not an
4560+
anonymity or traffic-hiding feature and does not attempt to hide traffic from
4561+
the proxy, the local network, network operators, or authorities that govern the
4562+
deployment.
4563+
4564+
Configure only proxies that are trusted and authorized for the deployment. A
4565+
proxy can observe connection metadata; for plain HTTP requests, or when TLS is
4566+
terminated or intercepted by the proxy, it can also observe request and response
4567+
contents. Node.js does not support treating an untrusted proxy as a privacy
4568+
boundary. Deployment operators are responsible for controlling proxy
4569+
configuration and for meeting deployment-specific network policy and legal
4570+
requirements.
4571+
45564572
### Proxy URL Format
45574573
45584574
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
@@ -1648,8 +1648,12 @@ See \fBSSL_CERT_DIR\fR and \fBSSL_CERT_FILE\fR.
16481648
.
16491649
.It Fl -use-env-proxy
16501650
When enabled, Node.js parses the \fBHTTP_PROXY\fR, \fBHTTPS_PROXY\fR and \fBNO_PROXY\fR
1651-
environment variables during startup, and tunnels requests over the
1651+
environment variables during startup, and routes requests through the
16521652
specified proxy.
1653+
Use this only with proxies that are trusted and authorized for the deployment.
1654+
Proxy support is intended for reaching external networks through authorized
1655+
proxy servers, for example when a firewall requires one. It is not for hiding
1656+
traffic or evading network policy. See Built-in Proxy Support.
16531657
This is equivalent to setting the \fBNODE_USE_ENV_PROXY=1\fR environment variable.
16541658
When both are set, \fB--use-env-proxy\fR takes precedence.
16551659
.
@@ -2310,8 +2314,12 @@ variable is strongly discouraged.
23102314
.It Ev NODE_USE_ENV_PROXY Ar 1
23112315

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

0 commit comments

Comments
 (0)