GHSA-wjr9-j795-jxcr

Suggest an improvement
Source
https://github.com/advisories/GHSA-wjr9-j795-jxcr
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-wjr9-j795-jxcr/GHSA-wjr9-j795-jxcr.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-wjr9-j795-jxcr
Aliases
Published
2026-10-23T21:37:59Z
Modified
2026-10-23T21:45:04Z
Severity
  • 4.8 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N CVSS Calculator
Summary
fast-uri vulnerable to host confusion via unchecked WHATWG host canonicalization
Details

Impact

fast-uri versions >= 2.4.2, <= 2.4.7, >= 3.1.3, <= 3.1.8, and >= 4.0.1, <= 4.2.2 can silently rewrite the host of an HTTP-family URL (http, https, ws, wss, or any scheme with domainHost: true). For those schemes canonicalizeHost() passes the parsed host to the WHATWG URL parser and adopts its .hostname without checking that the parser read the whole input as a host. RFC 3986 permits @ inside the host group and the WHATWG parser strips TAB, LF, and CR, so the authority fast-uri reports is rewritten by that second parser with no error set: data before an @ is dropped and whitespace is removed.

For example, fast-uri parses http://a@b@evil.example/ to host evil.example (dropping the b segment), and a host containing a raw TAB, CR, or LF has those characters stripped. equal() then treats a whitespace-smuggled host as the same as the clean one, and resolve() rewrites the authority the same way.

Applications that use fast-uri to enforce host-based policy (denylists, loopback filtering, redirect validation, outbound proxy routing) on one representation, such as the raw input, see a policy/use desync: the canonical host fast-uri returns differs from what was checked, and traffic can be steered to an unintended destination.

Patches

Upgrade to fast-uri 2.4.8, 3.1.9, or 4.2.3.

Workarounds

Reject URIs whose authority contains more than one @, or contains TAB, CR, or LF, before calling fast-uri. Alternatively, treat any non-empty parse(x).error as fatal, and compare hosts only from the same parse() result.

Database specific
{
    "cwe_ids":  [
        "CWE-20",
        "CWE-436"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-10-23T21:37:59Z",
    "nvd_published_at":  "2026-10-20T07:17:08Z",
    "severity":  "MODERATE"
}
References

Affected packages

npm / fast-uri

Package

Affected ranges

Type
SEMVER
Events
Introduced
2.4.2
Fixed
2.4.8

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-wjr9-j795-jxcr/GHSA-wjr9-j795-jxcr.json"

npm / fast-uri

Package

Affected ranges

Type
SEMVER
Events
Introduced
3.1.3
Fixed
3.1.9

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-wjr9-j795-jxcr/GHSA-wjr9-j795-jxcr.json"

npm / fast-uri

Package

Affected ranges

Type
SEMVER
Events
Introduced
4.0.1
Fixed
4.2.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-wjr9-j795-jxcr/GHSA-wjr9-j795-jxcr.json"