Skip to content

Commit 54c30f7

Browse files
UlisesGasconmcollina
authored andcommitted
docs: note suffix-reference authority ambiguity
Ref: GHSA-333x-w4r6-6crp
1 parent 39e6493 commit 54c30f7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ For schemes with domain hosts (`http`, `https`, `ws`, `wss`, or any scheme with
2424
* `reference` (string)
2525
If set to `"suffix"`, it indicates that the URI is in the suffix format and the parser will use the option's `scheme` property to determine the URI's scheme.
2626

27+
A suffix reference is written without its scheme and without the `//` authority marker (RFC 3986 section 4.5). Such a reference is inherently ambiguous: an authority component cannot always be distinguished from a path. When the input carries an authority of the form `host:port` (for example `//javascript:80/x`) or a userinfo containing a colon, the serialized suffix output can begin with text that reparses as a URI scheme (for example `javascript:80/x`). Do not treat suffix output as a trusted absolute URL, and do not render it or use it in a scheme allowlist without first validating it with `parse()`. If you need an unambiguous result, use the default (non-suffix) serialization.
28+
2729
* `tolerant` (boolean, false)
2830
If set to `true`, the parser will relax URI resolving rules.
2931

0 commit comments

Comments
 (0)