Skip to content

Commit ff002c2

Browse files
committed
doc: clarify url.parse security warning
1 parent e568673 commit ff002c2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

doc/api/url.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,11 +1921,13 @@ A `TypeError` is thrown if `urlString` is not a string.
19211921

19221922
A `URIError` is thrown if the `auth` property is present but cannot be decoded.
19231923

1924-
`url.parse()` uses a lenient, non-standard algorithm for parsing URL
1925-
strings. It is prone to security issues such as [host name spoofing][]
1926-
and incorrect handling of usernames and passwords. Do not use with untrusted
1927-
input. CVEs are not issued for `url.parse()` vulnerabilities. Use the
1928-
[WHATWG URL][] API instead, for example:
1924+
`url.parse()` can be used with URLs from trusted input, such as application
1925+
configuration. It uses a lenient, non-standard algorithm for parsing URL
1926+
strings, so do not use it with untrusted input or when parsed URL components
1927+
are used for security decisions. It is prone to security issues such as
1928+
[host name spoofing][] and incorrect handling of usernames and passwords. CVEs
1929+
are not issued for `url.parse()` vulnerabilities. Use the [WHATWG URL][] API
1930+
instead, for example:
19291931

19301932
```js
19311933
function getURL(req) {

0 commit comments

Comments
 (0)