Commit 84e7388
url: improve port validation
If a port is not a number, throw rather than treating the `:` that
delineates the port as part of the path. This is consistent with WHATWG
URL and also mitigates hostname-spoofing.
Concerns about hostname-spoofing were raised and presented in excellent
detail by pyozzi-toss (pyozzi@toss.im/Security-Tech Team in Toss).
PR-URL: #45012
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent d47f832 commit 84e7388Copy full SHA for 84e7388
File tree
Expand file treeCollapse file tree
3 files changed
+18
-18
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+18
-18
lines changedOpen diff view settings
Collapse file
+6-2Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
383 | 383 | |
384 | 384 | |
385 | 385 | |
386 | | - |
| 386 | + |
387 | 387 | |
388 | 388 | |
389 | 389 | |
| ||
502 | 502 | |
503 | 503 | |
504 | 504 | |
505 | | - |
| 505 | + |
506 | 506 | |
507 | 507 | |
508 | 508 | |
| ||
512 | 512 | |
513 | 513 | |
514 | 514 | |
| 515 | + |
| 516 | + |
| 517 | + |
| 518 | + |
515 | 519 | |
516 | 520 | |
517 | 521 | |
|
Collapse file
test/parallel/test-url-parse-format.js
Copy file name to clipboardExpand all lines: test/parallel/test-url-parse-format.js-16Lines changed: 0 additions & 16 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
865 | 865 | |
866 | 866 | |
867 | 867 | |
868 | | - |
869 | | - |
870 | | - |
871 | | - |
872 | | - |
873 | | - |
874 | | - |
875 | | - |
876 | | - |
877 | | - |
878 | | - |
879 | | - |
880 | | - |
881 | | - |
882 | | - |
883 | | - |
884 | 868 | |
885 | 869 | |
886 | 870 | |
|
Collapse file
test/parallel/test-url-parse-invalid-input.js
Copy file name to clipboardExpand all lines: test/parallel/test-url-parse-invalid-input.js+12Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
74 | 74 | |
75 | 75 | |
76 | 76 | |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
0 commit comments