7.5high
fast-uri vulnerable to authority injection via an unvalidated port in serialize
- Severity
- 7.5high CVSS:3.1 by openjs
- Exploit likelihood
- 0.24% (higher than 16% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- openjs
- Also known as
- GHSA-qw65-cvwx-89v3
Description
fast-uri serializes the port component of a URI without validating it. When recomposing the authority, the userinfo and host components are escaped but the port is concatenated verbatim, so a port value that is not a sequence of digits can inject authority delimiters, 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 through the serialize, normalize, or equal functions in their object forms. The issue affects fast-uri versions before 2.4.6, from 3.0.0 before 3.1.7, and from 4.0.0 before 4.1.4. It is fixed in 2.4.6, 3.1.7, and 4.1.4, where recomposeAuthority rejects any port that is not a digit sequence per RFC 3986.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| fast-uri fast-uri | before 2.4.6, from 3.0.0 before 3.1.7, from 4.0.0 before 4.1.4 Not affected: 2.4.6, 3.1.7, 4.1.4 | CVE List |
| fast-uri (npm) | before 2.4.6, from 3.0.0 before 3.1.7, from 4.0.0 before 4.1.4 | GitHub Advisory Database |
| openjsf fast-uri | before 2.4.6, from 3.0.0 before 3.1.7, from 4.0.0 before 4.1.4 | NVD |
All scores
| openjs | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
fast-uri serializes the port component of a URI without validating it. When recomposing the authority, the userinfo and host components are escaped but the port is concatenated verbatim, so a port value that is not a sequence of digits can inject authority delimiters, 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 through the serialize, normalize, or equal functions in their object forms. The issue affects fast-uri versions before 2.4.6, from 3.0.0 before 3.1.7, and from 4.0.0 before 4.1.4. It is fixed in 2.4.6, 3.1.7, and 4.1.4, where recomposeAuthority rejects any port that is not a digit sequence per RFC 3986.
GitHub Advisory Database
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').
NVD (es)
fast-uri serializa el componente de puerto de una URI sin validarlo. Al recomponer la autoridad, los componentes userinfo y host se escapan, pero el puerto se concatena textualmente, por lo que un valor de puerto que no es una secuencia de dígitos puede inyectar delimitadores de autoridad, degradando el host previsto a userinfo y apuntando la autoridad a un host controlado por el atacante. Tanto fast-uri como la URL de Node leen el resultado como el host del atacante sin error, por lo que revalidar la URI construida no lo detecta. Esto afecta a las aplicaciones que construyen URIs a partir de partes y asignan datos no confiables al componente de puerto a través de las funciones serialize, normalize o equal en sus formas de objeto. El problema afecta a las versiones de fast-uri anteriores a la 2.4.6, desde la 3.0.0 anteriores a la 3.1.7, y desde la 4.0.0 anteriores a la 4.1.4. Se ha corregido en la 2.4.6, la 3.1.7 y la 4.1.4, donde recomposeAuthority rechaza cualquier puerto que no sea una secuencia de dígitos según la RFC 3986.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-84292 changed 2026-09-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-qw65-cvwx-89v3 changed 2026-09-28 | CC-BY-4.0 |
| NVD | CVE-2026-84292 changed 2026-10-06 | Public domain |