/

CVE-2026-84292

Severity:

HIGH RISK

(7.5)

URI Authority Injection (CWE-116) in fast-uri Parser

CVE-2026-84292

Analyzed

Vulnerability type

Category:

Improper Output Encoding

CWE:

CWE-116

Impact:

URI Authority Confusion and Host Redirection

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

fast-uri can serialize an untrusted URI port value without verifying that it contains only digits. A malformed port may inject authority delimiters, reinterpret the intended host as user information, and redirect the resulting URI to an attacker-controlled host when applications build URIs from separate components.

Affected context

The issue can occur in applications that use fast-uri object-form APIs to serialize, normalize, or compare URIs assembled from individual components. Risk increases when an untrusted value is assigned to the port field and the resulting URI is later used for routing, fetching resources, authentication decisions, or security validation. Re-parsing the generated URI may not reveal the problem because URI parsers can accept the recomposed authority and interpret the attacker-controlled host as valid.

Exploit preconditions

  • Attack surface: Application code that constructs URIs from structured components through fast-uri.
  • Required access: Ability to influence the port component supplied to the serialize, normalize, or equal object forms.
  • Trigger point: Authority recomposition followed by use or interpretation of the generated URI.
  • Why exploitation is possible: The port is concatenated without the encoding and syntax validation applied to other authority components, allowing delimiter characters to alter authority parsing.

Why this happens

The vulnerability is caused by inconsistent validation and escaping during URI authority serialization. Although the userinfo and host components are escaped, the port component is emitted verbatim rather than being restricted to the digit sequence permitted by RFC 3986. This is an instance of CWE-116: Improper Encoding or Escaping of Output, because attacker-controlled data is incorporated into a structured URI without preserving the intended component boundaries.

Potential impact

  • The generated URI may resolve to an attacker-controlled host.
  • Applications could send requests or credentials to an unintended destination.
  • Host-based allowlists, routing logic, or security checks may be bypassed.
  • Server-side request forgery-like behavior could occur where the URI is used for outbound requests.
  • Authentication, logging, or audit decisions could be based on a misleading URI interpretation.

General mitigation guidance

Mitigation generally focuses on preserving URI component boundaries and reducing trust in externally supplied components.

Common defensive patterns include:

  • Restricting port values to a validated sequence of decimal digits before serialization.
  • Using a URI recomposition implementation that rejects invalid port syntax rather than emitting it.
  • Treating host, userinfo, port, and other authority fields as separate typed values throughout application logic.
  • Avoiding security decisions based solely on re-parsing a URI that was assembled from untrusted parts.
  • Applying destination allowlists after canonicalization and validating the final authority against the intended destination.
  • Running outbound URI consumers with least privilege and appropriate network egress controls.
  • Using a maintained fast-uri release that includes strict port validation, without relying on downstream re-validation alone.

How teams detect issues like this

Detection approaches can include:

  • Static analysis for object-form URI construction where user-controlled data reaches a port property.
  • Code review checks for URI fields concatenated or serialized without component-specific validation.
  • Tests covering non-numeric, delimiter-containing, empty, and boundary port values.
  • Policy enforcement requiring structured URI builders to reject invalid authority components.
  • Runtime monitoring for generated requests whose effective host differs from the application's intended host.
  • Automated dependency and code review tools that flag vulnerable fast-uri usage patterns and outdated dependency ranges.

Sources

SourceLink
cna.openjsf.orgcna.openjsf.org/security-advisories.html
github.comgithub.com/fastify/fast-uri/security/advisories/GHSA-qw65-cvwx-89v3

Frequently asked

questions

It can be exploitable through an application's existing input path when an attacker can influence the port component and the resulting URI is used in a security-sensitive or network-facing operation. The library issue alone does not necessarily provide a direct network entry point.

The attacker generally needs a way to supply or influence structured URI data, specifically the port field, through an application endpoint, configuration source, API, or another input channel.

Reject port values that are not valid decimal digit sequences before authority recomposition, and use a URI builder that enforces component-specific syntax rather than concatenating fields verbatim.

Keep URI components structured, validate each component according to its grammar, test parser and serializer round trips with hostile inputs, and avoid treating successful re-parsing as proof that the original authority was safe.

Find out what's already
exploitable in your codebase.