Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ebb30b

Browse filesBrowse files
jasnelladdaleax
authored andcommitted
doc: document security issues with url.parse()
Fixes: #31279 PR-URL: #34226 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 4e07faa commit 0ebb30b
Copy full SHA for 0ebb30b

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/url.md‎

Copy file name to clipboardExpand all lines: doc/api/url.md
+7Lines changed: 7 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,12 @@ A `TypeError` is thrown if `urlString` is not a string.
12441244

12451245
A `URIError` is thrown if the `auth` property is present but cannot be decoded.
12461246

1247+
Use of the legacy `url.parse()` method is discouraged. Users should
1248+
use the WHATWG `URL` API. Because the `url.parse()` method uses a
1249+
lenient, non-standard algorithm for parsing URL strings, security
1250+
issues can be introduced. Specifically, issues with [host name spoofing][] and
1251+
incorrect handling of usernames and passwords have been identified.
1252+
12471253
### `url.resolve(from, to)`
12481254
<!-- YAML
12491255
added: v0.1.25
@@ -1361,6 +1367,7 @@ console.log(myURL.origin);
13611367
[WHATWG URL Standard]: https://url.spec.whatwg.org/
13621368
[WHATWG URL]: #url_the_whatwg_url_api
13631369
[examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing
1370+
[host name spoofing]: https://hackerone.com/reports/678487
13641371
[legacy `urlObject`]: #url_legacy_urlobject
13651372
[percent-encoded]: #whatwg-percent-encoding
13661373
[stable sorting algorithm]: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.