CVE-2026-86472: fast-uri vulnerable to inconsistent host case normalization via percent-encoded octets

Medium CVSS 4.8

OSV id
GHSA-hrr3-gc8f-f4qj
Also known as
CVE-2026-86472
Published
Last modified

Affected packages

PackageAffected versionsFixed in
fast-uri
npm
< 2.4.7 2.4.7
fast-uri
npm
>= 3.0.0, < 3.1.8 3.1.8
fast-uri
npm
>= 4.0.0, < 4.1.5 4.1.5

Versions we track that it affects: fast-uri 3.1.5; fast-uri 3.1.5; fast-uri 3.1.5

How to fix it

fast-uri (npm)

Upgrade fast-uri to 2.4.7 or later.

npm install fast-uri@2.4.7
# if it is an indirect dependency: npm update fast-uri (or npm audit fix)
  • If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

fast-uri (npm)

Upgrade fast-uri to 3.1.8 or later.

npm install fast-uri@3.1.8
# if it is an indirect dependency: npm update fast-uri (or npm audit fix)
  • If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

fast-uri (npm)

Upgrade fast-uri to 4.1.5 or later.

npm install fast-uri@4.1.5
# if it is an indirect dependency: npm update fast-uri (or npm audit fix)
  • If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

Not sure whether your project uses an affected version? Check your lockfile below for free.

Details

Impact

fast-uri folds the host to lowercase before it percent-decodes the host, so a percent-encoded uppercase unreserved octet such as %41 decodes to a literal A that is never folded. For a scheme-relative reference (//host) there is no scheme, so the host canonicalization that repairs this on a scheme-bearing URL does not run. As a result parse, normalize, and equal disagree on the same host: parse("//%41.com").host returns "A.com" while parse("//a.com").host and parse("//A.com").host return "a.com", and equal("//%41.com", "//a.com") is false even though equal("//A.com", "//a.com") is true. An application that makes a case-sensitive host decision on fast-uri output for a scheme-relative reference, for example a host allowlist or denylist that compares parse(url).host or uses fast-uri.equal, can be steered past the check with a percent-encoded uppercase octet. Because a hostname is case-insensitive in DNS and HTTP routing, the evading spelling reaches the same host the check meant to gate, so the effect is check evasion rather than reaching a different registrable host.

Patches

Upgrade to fast-uri 4.1.5, 3.1.8, or 2.4.7.

Workarounds

Compare hosts case-insensitively (lowercase the parsed host before any allowlist or denylist decision), or avoid making case-sensitive host decisions on scheme-relative input until upgrading.

References

Am I affected?

Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.

or paste its content

Needed when you paste. package.json and pyproject.toml only have version ranges: use the lockfile next to them.

Only package names and versions are checked; the file itself is not kept. We use your email to send this report and nothing else unless you tick the box above. Privacy policy.

About this data

Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.