Sep 29, 2026·7 min read·45 visits
Unvalidated port serialization in fast-uri allows remote attackers to perform authority injection and redirect connections to external hosts.
An authority injection vulnerability exists in the serialization components of fast-uri (versions before 2.4.6, 3.1.7, and 4.1.4) where unvalidated port components can contain authority delimiters (such as '@'). This results in host demotion to userinfo, redirection of traffic to an arbitrary attacker-controlled host, and downstream Server-Side Request Forgery (SSRF) without causing parser errors in standard clients.
The library fast-uri is a high-performance URI parser and serializer toolbox compliant with RFC 3986, widely used in Node.js applications such as the Fastify framework. The serialization subsystem translates structured objects containing scheme, host, port, and query properties into valid URI strings. This interface acts as a critical boundary where structured data is serialized for consumption by network clients.
CVE-2026-84292 represents an authority injection vulnerability within the serialization module of fast-uri. The parser fails to validate that the provided port is a strictly numeric sequence before concatenating it onto the reconstituted authority. This allows an attacker to inject special characters, altering the syntactic structure of the final serialized URI.
Standard URI parsers, including Node.js's native URL class and downstream HTTP request clients, parse the malformed serialization result differently. Instead of rejecting the input, they process injected @ symbols as userinfo delimiters. This demotes the original host to userinfo and elevates an attacker-supplied domain as the true target host, bypassing host-based validation filters.
The root cause resides in lib/utils.js within the recomposeAuthority function, which is responsible for building the authority component of the URI. The library implements escaping and validation logic for userinfo and host to prevent injection attacks. However, it handles the port property with a simple type check that accepts both strings and numbers without evaluating their contents.
RFC 3986 Section 3.2.3 strictly defines the port component as a sequence of zero or more decimal digits. By accepting arbitrary strings and concatenating them directly to the authority component, fast-uri deviates from the RFC standard. The unvalidated value is appended verbatim following a colon character, introducing a vector for control character injections.
If the injected string contains an @ symbol, it shifts the boundaries of the parsed URI. According to RFC 3986, the authority string is scanned for an @ character; all text preceding the leftmost @ is interpreted as username and password credentials. Consequently, injecting @attacker.com forces downstream parsers to treat the original legitimate host as a username and the injected domain as the authority host.
A secondary issue relates to malformed bracket handling in hosts. The library assumed that any host starting with [ was a valid IP-literal without validating the terminating ]. This discrepancy allowed attackers to exploit parser differential flaws where unbalanced or misplaced brackets bypassed validation checks, leaving the application vulnerable to connection routing manipulation.
To understand the vulnerability, analyze the original implementation of recomposeAuthority in lib/utils.js. In this block, the function inspects the type of component.port and directly pushes its string representation onto the token buffer if it evaluates to a string or number.
// VULNERABLE (fast-uri < 2.4.6)
if (typeof component.port === 'number' || typeof component.port === 'string') {
uriTokens.push(':')
uriTokens.push(String(component.port)) // String is concatenated verbatim
}// PATCHED (fast-uri >= 2.4.6)
const isPort = RegExp.prototype.test.bind(/^\d*$/u)
if (typeof component.port === 'number' || typeof component.port === 'string') {
const port = String(component.port)
if (!isPort(port)) {
throw new TypeError('URI port is malformed.') // Throws an error for non-digit inputs
}
uriTokens.push(':')
uriTokens.push(port)
}The patch introduces the isPort regular expression-based validator, which restricts the port string to only digit characters using /^\d*$/u. When a non-digit character is detected within the port string, the library throws a TypeError and halts serialization. This prevents the generation of syntactically invalid or malicious URIs entirely, solving the vulnerability at the serialization stage.
Additionally, the patch modifies index.js to harden IP-literal verification. The helper function isIPLiteral is introduced to verify that bracketed hosts strictly start with [ and end with ]. This prevents incomplete bracketed hosts, such as [fe80, from bypassing canonicalization routines and escaping validation steps.
Exploitation of CVE-2026-84292 depends on an application exposing control of the port variable to an external actor during URI reconstruction. This scenario occurs in integrations where application configurations, webhooks, or dynamic API endpoints are built programmatically from client-supplied parameters. Because the library is designed for performance, developers often trust its output without implementing supplementary application-level input validation.
An attacker crafts a payload targeting the port property, containing authority delimiters such as @ or path segment delimiters. If the backend is intended to construct a URI to an internal database or API at http://internal-service.local, sending a port string like @malicious-server.example alters the authority layout. The resulting serialized string becomes http://internal-service.local:@malicious-server.example.
When the application client processes this URI, it interprets internal-service.local: as userinfo and issues the HTTP request directly to malicious-server.example. The attack succeeds silently, as standard parser frameworks do not raise errors during compilation or request execution. This enables the attacker to intercept sensitive authentication tokens, internal request paths, or perform arbitrary outbound API requests.
This attack vector is particularly effective at bypassing whitelist-based URL filters. A security filter that verifies the serialized URI using simple substring lookups (e.g., checking if the string contains internal-service.local) would pass the malformed URL. The vulnerability exploits the structural parsing difference between basic string matching and formal RFC 3986 parsing.
The direct consequence of this vulnerability is the breakdown of integrity in URI serialization. It undermines the trust boundary between the serialization library and the network client. While the CVSS v3.1 score of 7.5 reflects high integrity impact, the practical security risk depends heavily on the execution environment.
If the serialized URIs are forwarded to internal HTTP clients, the vulnerability is a highly reliable vector for Server-Side Request Forgery (SSRF). Attackers can access internal services, compromise metadata endpoints in cloud environments, or query restricted internal administration portals.
The flaw can also be used to execute open redirects or bypass domain-based security boundaries in OAuth configurations, single sign-on flows, or safe-origin checks. Since fast-uri serves as a core dependency within Fastify and other Node.js routing frameworks, the potential exposure across downstream packages is significant.
Currently, the exploit maturity is categorized as proof-of-concept. No functional, weaponized exploit code is observed in the wild. The EPSS score remains low at 0.0038, which represents a minimal probability of automated scanning or bulk exploitation at this stage, but the vulnerability warrants proactive remediation given its critical structural implications.
The primary and most effective remediation strategy is to upgrade fast-uri to the patched versions. For environments running the 2.x branch, update to 2.4.6. For 3.x deployments, upgrade to 3.1.7. For 4.x deployments, transition to 4.1.4. These versions enforce correct RFC 3986 validation rules within the recomposeAuthority component.
If an immediate dependency upgrade is blocked, implementing application-level input sanitization is necessary. Applications should run a strict regular expression validation on all user-supplied port variables before passing them to the URI reconstruction context. The validator must ensure the input consists exclusively of ASCII digit characters.
Implement defense-in-depth measures at the network level to mitigate downstream SSRF risks. Restrict outbound network access from sensitive application servers using egress firewall rules or security groups. Furthermore, configure internal HTTP clients to reject requests pointing to loopback addresses, local private subnets (RFC 1918), or cloud metadata services unless explicitly required by design.
Finally, ensure development workflows utilize software composition analysis (SCA) tooling. Continuous scanning of the Node.js package dependency graph will flag outdated versions of fast-uri or indirect occurrences resolved via transitively imported libraries. This ensures that the vulnerability is identified and mitigated across all codebases in the enterprise.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
fast-uri OpenJS Foundation | < 2.4.6 | 2.4.6 |
fast-uri OpenJS Foundation | >= 3.0.0 < 3.1.7 | 3.1.7 |
fast-uri OpenJS Foundation | >= 4.0.0 < 4.1.4 | 4.1.4 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-116 |
| Attack Vector | Network |
| CVSS Score | 7.5 (High) |
| EPSS Score | 0.0038 |
| Impact | Integrity |
| Exploit Status | poc |
| KEV Status | Not Listed |
The software does not sanitize or escape output correctly, allowing attackers to inject structural delimiters that alter the interpretation of the output.
CVE-2026-126078 is a Cross-Site Scripting (XSS) vulnerability classified under CWE-79 affecting the Action View component of Ruby on Rails in versions prior to 8.0.5.2 and 8.1.4.1. The vulnerability resides in the ActionView::Helpers::TextHelper#highlight method when invoked with a custom :highlighter template that places capture group placeholders inside HTML attribute values. Because matched substrings are substituted without HTML escaping after initial sanitization preserves literal quotation marks, an attacker controlling the input text or target search phrase can break out of the surrounding attribute delimiter and inject arbitrary HTML attributes or JavaScript event handlers.
An information exposure vulnerability in Ruby on Rails Action Pack allows sensitive session cookies to be attached to public, cacheable responses served by Active Storage proxy controllers. When cookie secret rotation or a hybrid cookie serializer migration is enabled, reading a legacy-format cookie triggers an automatic cookie rewrite that ignores the session-skipping directive. If an intermediate shared cache or CDN caches the resulting response along with its Set-Cookie header, subsequent users requesting the same URL receive the leaked session token.
CVE-2026-126072 (GHSA-rwvh-fw6r-pwvp) is a concurrency deadlock vulnerability in the Ruby on Rails Action Pack framework affecting applications that utilize ActionController::Live response streaming. The defect occurs due to improper synchronization within ActionController::Live::Buffer when handling full bounded queues during stream closure and connection abortion. An unauthenticated remote attacker can trigger this condition by stalling TCP socket reads on streaming endpoints—including Active Storage proxy mode—resulting in permanent worker thread exhaustion and application-wide denial of service.
CVE-2026-126192 is an algorithmic complexity vulnerability in Soup Sieve (soupsieve), the default CSS selector engine for Beautiful Soup 4 in Python. Evaluating a CSS selector that contains a general sibling combinator (~) nested inside a :has() relational pseudo-class against attacker-controlled HTML markup triggers O(n^2) quadratic evaluation complexity when the right-hand sibling target is absent. An unauthenticated attacker can supply small HTML documents containing thousands of sibling elements to exhaust CPU resources and stall application worker threads.
CVE-2026-126190 (GHSA-mmhr-3c5m-f64f) is an inefficient algorithmic complexity vulnerability (CWE-407) in Soup Sieve, the default CSS selector library integrated into Beautiful Soup 4. In versions prior to 4.0, evaluating CSS selectors that contain descendant combinators (whitespace between compound selectors) executes an unmemoized upward traversal of the document tree. When evaluated against deeply nested HTML or XML documents, the time complexity scales polynomially at O(n^(k+1)), where n is the tree depth and k is the number of descendant combinators. Remote attackers can supply compact, deeply nested markup (1 KB to 4 KB) to trigger prolonged CPU starvation and denial of service in Python applications.
CVE-2026-122006 is a critical vulnerability in the Ruby on Rails Active Storage framework affecting versions prior to 8.0.5.2 and 8.1.4.1. When an application processes uploaded file attachments using the ImageMagick variant processor (:mini_magick), the framework invokes ImageMagick's metadata analyzer without applying a restrictive security policy. An unauthenticated attacker can upload a crafted file containing directives for unrestricted ImageMagick coders, such as Magick Scripting Language (MSL), resulting in arbitrary server-side file read and write operations. In deployments using the Disk storage service, attackers can exfiltrate sensitive application configuration files, including secret_key_base and master encryption keys, which enables remote code execution via signed payload forgery.