Skip to content

Commit 8642eac

Browse files
ChALkeRtargos
authored andcommitted
doc: inspector security warning for changing host
Refs: #23444 Refs: #21774 PR-URL: #23640 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
1 parent 5ea48a9 commit 8642eac

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

doc/api/cli.md

+21
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ Useful when activating the inspector by sending the `SIGUSR1` signal.
144144

145145
Default host is `127.0.0.1`.
146146

147+
See the [security warning](#inspector_security) below regarding the `host`
148+
parameter usage.
149+
147150
### `--inspect[=[host:]port]`
148151
<!-- YAML
149152
added: v6.3.0
@@ -155,6 +158,22 @@ V8 inspector integration allows tools such as Chrome DevTools and IDEs to debug
155158
and profile Node.js instances. The tools attach to Node.js instances via a
156159
tcp port and communicate using the [Chrome DevTools Protocol][].
157160

161+
<a id="inspector_security"></a>
162+
#### Warning: binding inspector to a public IP:port combination is insecure
163+
164+
Binding the inspector to a public IP (including `0.0.0.0`) with an open port is
165+
insecure, as it allows external hosts to connect to the inspector and perform
166+
a [remote code execution][] attack.
167+
168+
If you specify a host, make sure that at least one of the following is true:
169+
either the host is not public, or the port is properly firewalled to disallow
170+
unwanted connections.
171+
172+
**More specifically, `--inspect=0.0.0.0` is insecure if the port (`9229` by
173+
default) is not firewall-protected.**
174+
175+
See the [debugging security implications][] section for more information.
176+
158177
### `--loader=file`
159178
<!-- YAML
160179
added: v9.0.0
@@ -741,6 +760,8 @@ greater than `4` (its current default value). For more information, see the
741760
[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
742761
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
743762
[debugger]: debugger.html
763+
[debugging security implications]: https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
744764
[emit_warning]: process.html#process_process_emitwarning_warning_type_code_ctor
745765
[experimental ECMAScript Module]: esm.html#esm_loader_hooks
746766
[libuv threadpool documentation]: http://docs.libuv.org/en/latest/threadpool.html
767+
[remote code execution]: https://www.owasp.org/index.php/Code_Injection

doc/api/inspector.md

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ started.
4343
If wait is `true`, will block until a client has connected to the inspect port
4444
and flow control has been passed to the debugger client.
4545

46+
See the [security warning](cli.html#inspector_security) regarding the `host`
47+
parameter usage.
48+
4649
## inspector.url()
4750

4851
* Returns: {string|undefined}

0 commit comments

Comments
 (0)