Commit 2a580b9
lib: add warning when binding inspector to public IP
Add `isLoopback` function to `internal/net` module to check if a given
host is a loopback address.
Add a warning when binding the inspector to a public IP with an open
port, as it allows external hosts to connect to the inspector.
Fixes: #23444
Refs: https://nodejs.org/api/cli.html#--inspecthostport
PR-URL: #55736
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>1 parent c45894f commit 2a580b9Copy full SHA for 2a580b9
File tree
Expand file treeCollapse file tree
4 files changed
+78
-0
lines changedOpen diff view settings
Filter options
- lib
- internal
- test/parallel
Expand file treeCollapse file tree
4 files changed
+78
-0
lines changedOpen diff view settings
Collapse file
+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
18 | 18 | |
19 | 19 | |
20 | 20 | |
| 21 | + |
| 22 | + |
21 | 23 | |
22 | 24 | |
23 | 25 | |
| ||
172 | 174 | |
173 | 175 | |
174 | 176 | |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
175 | 188 | |
176 | 189 | |
177 | 190 | |
|
Collapse file
+17Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
68 | 68 | |
69 | 69 | |
70 | 70 | |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
71 | 87 | |
72 | 88 | |
73 | 89 | |
74 | 90 | |
75 | 91 | |
76 | 92 | |
77 | 93 | |
| 94 | + |
78 | 95 | |
Collapse file
test/parallel/test-inspector-host-warning.js
Copy file name to clipboard+16Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
Collapse file
test/parallel/test-internal-net-isLoopback.js
Copy file name to clipboard+32Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
0 commit comments