CVE-2026-84292: fast-uri vulnerable to authority injection via an unvalidated port in serialize
High CVSS 7.5
- OSV id
- GHSA-qw65-cvwx-89v3
- Also known as
- CVE-2026-84292
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| fast-uri npm |
< 2.4.6 | 2.4.6 |
| fast-uri npm |
>= 3.0.0, < 3.1.7 | 3.1.7 |
| fast-uri npm |
>= 4.0.0, < 4.1.4 | 4.1.4 |
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.6 or later.
npm install fast-uri@2.4.6
# 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.7 or later.
npm install fast-uri@3.1.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 4.1.4 or later.
npm install fast-uri@4.1.4
# 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 serializes the port component of a URI without validating it. When recomposing the authority, fast-uri escapes the userinfo and host components but concatenates the port verbatim, so a port value that is not a sequence of digits can inject authority delimiters. For example, serializing a component whose port is @127.0.0.1:8124 produces http://trusted.example:@127.0.0.1:8124/app, demoting the intended host to userinfo and pointing the authority at an attacker-controlled host. Both fast-uri and Node's URL read the result back as the attacker's host with no error, so re-validating the built URI does not catch it.
This affects applications that build URIs from parts and assign untrusted data to the port component (for example a fixed host from configuration and a port taken from user input or a service record). The same path is reachable through serialize(), normalize(), and equal() in their object forms. A port obtained from parse() is always digits and is not affected.
Patches
This vulnerability has been patched in fast-uri 4.1.4, 3.1.7, and 2.4.6. recomposeAuthority now rejects any port that is not *DIGIT per RFC 3986. All users should upgrade.
Workarounds
If upgrading is not immediately possible, validate the port value against the RFC 3986 grammar (digits only) before passing a component to serialize(), normalize(), or equal(), and reject anything else, for example if (!/^\d*$/.test(String(port))) throw new Error('invalid port').
References
- GHSA-qw65-cvwx-89v3 on OSV.dev
- Web: https://github.com/fastify/fast-uri/security/advisories/GHSA-qw65-cvwx-89v3
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2026-84292
- Web: https://github.com/fastify/fast-uri/commit/820e8478dd7da3d09f187bfaf35d50b71f67b8b4
- Web: https://cna.openjsf.org/security-advisories.html
- Package: https://github.com/fastify/fast-uri
- Web: https://github.com/fastify/fast-uri/releases/tag/v2.4.6
- Web: https://github.com/fastify/fast-uri/releases/tag/v3.1.7
- Web: https://github.com/fastify/fast-uri/releases/tag/v4.1.4
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.
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.