Apr 11, 2026·5 min read·21 visits
Unsanitized ASCII control characters in next-intl middleware paths allow unauthenticated attackers to execute open redirects via protocol-relative URLs.
An open redirect vulnerability exists in the next-intl middleware for Next.js applications prior to version 4.9.1. The sanitization logic fails to account for WHATWG URL Specification rules regarding ASCII control characters, allowing attackers to craft malicious links that bypass validation and execute protocol-relative redirects to arbitrary external domains.
The next-intl library provides internationalization capabilities for Next.js applications. It utilizes middleware to manage locale-based routing, handling user navigation across different language variants. This middleware normalizes URLs, manages redirects, and ensures requests are correctly prefixed with the appropriate locale.
Versions of next-intl prior to 4.9.1 contain an open redirect vulnerability (CWE-601) within the middleware routing logic. The flaw allows an unauthenticated remote attacker to craft specific URIs that redirect users to arbitrary external domains. The vulnerability stems from incomplete sanitization of URL paths containing specific ASCII control characters.
The vulnerability is currently tracked under the GitHub Security Advisory GHSA-8f24-v5vv-gm5j. While open redirects are generally classified as moderate severity, they serve as a critical enabler for targeted phishing campaigns and OAuth token leakage. Security teams should prioritize patching applications utilizing the vulnerable middleware component.
The vulnerability exists within the sanitizePathname function located in packages/next-intl/src/middleware/utils.tsx. This function normalizes incoming request paths to prevent malicious redirects, specifically attempting to neutralize protocol-relative URLs that begin with double slashes (//).
Prior to the patch, the sanitization logic performed only two operations: encoding backslashes (\) as %5C and collapsing multiple consecutive slashes (//+) into a single slash (/). This implementation failed to account for the WHATWG URL Specification, which governs how modern browsers parse and construct URLs.
The WHATWG specification mandates that certain ASCII control characters—specifically TAB (U+0009), LF (U+000A), and CR (U+000D)—are silently stripped during URL parsing. When a user requests a path containing these characters, the middleware preserves them, but the client-side browser subsequently removes them when resolving the redirect target. This discrepancy between server-side sanitization and client-side parsing creates the conditions for the open redirect.
The patch introduces a critical string replacement operation within the sanitizePathname function. The original implementation missed the removal of ASCII control characters, allowing them to pass through the middleware's normalization process intact.
// Vulnerable Implementation
export function sanitizePathname(pathname: string) {
return pathname
.replace(/\\/g, '%5C')
.replace(/\/+/g, '/');
}The updated code, introduced in commit 1c80b668aa6d853f470319eec10a3f61e78a70e6, implements an explicit removal of TAB, LF, and CR characters. This replacement occurs immediately after backslash encoding and before slash collapsing.
// Patched Implementation
export function sanitizePathname(pathname: string) {
return pathname
.replace(/\\/g, '%5C')
.replace(/[\t\n\r]/g, '') // Strips TAB, LF, CR
.replace(/\/+/g, '/');
}By stripping these characters on the server side, the middleware effectively aligns its normalization logic with the WHATWG specification. If an attacker attempts to inject a TAB character between slashes, the server now strips the TAB and subsequently collapses the resulting double slash into a single slash, neutralizing the protocol-relative URL attack vector.
Exploitation requires the attacker to construct a URL targeting a Next.js application running a vulnerable version of next-intl. The attacker embeds an encoded control character, such as %09 (TAB), strategically within the URL path. A typical payload follows the structure http://<victim-domain>/<locale>/%09/attacker.com.
When the victim clicks the crafted link, the next-intl middleware processes the request. It decodes the URL-encoded characters, resulting in a path structured as /en/[TAB]/attacker.com. The middleware then attempts to normalize this path by removing the locale prefix and issues an HTTP redirect instruction to the client.
Upon receiving the redirect response, the victim's browser processes the target URL /[TAB]/attacker.com. Following the WHATWG specification, the browser silently drops the TAB character. The resulting string //attacker.com is interpreted as a protocol-relative URL, instructing the browser to initiate a request to the external domain attacker.com.
The primary impact of this vulnerability is the facilitation of sophisticated phishing campaigns. Attackers leverage the reputation and trust of the vulnerable domain to construct convincing links. When victims click these links, they are transparently redirected to an attacker-controlled site designed to harvest credentials or distribute malware.
Beyond basic phishing, open redirects often serve as a critical stepping stone in complex attack chains. If the vulnerable application implements OAuth or similar authentication flows, attackers can utilize the open redirect to exfiltrate authorization codes or access tokens by manipulating callback URIs.
The vulnerability is classified as moderate severity, reflecting the requirement for user interaction. The execution relies exclusively on social engineering to prompt a victim to initiate the malicious request. However, the lack of authentication requirements and the high success rate of domain-trusted phishing links warrant immediate remediation.
The primary remediation strategy requires upgrading the next-intl package to version 4.9.1 or later. This update contains the necessary logic to strip ASCII control characters during path sanitization. Development teams should execute npm install next-intl@latest to apply the fix.
Organizations unable to deploy the patch immediately can mitigate the vulnerability using Web Application Firewall (WAF) rules. Administrators should configure the WAF to intercept and drop HTTP requests containing encoded control characters (%09, %0A, %0D) within the request path.
Security engineers should also review existing application routing logic for similar URL parsing discrepancies. The misalignment between server-side path normalization and client-side URL parsing is a common source of bypasses in routing middleware. Relying exclusively on regex-based string replacements often leaves edge cases exposed to manipulation.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
next-intl amannn | < 4.9.1 | 4.9.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-601 |
| Attack Vector | Network |
| CVSS v4.0 Score | Moderate |
| Exploit Status | Proof-of-Concept |
| Impact | Open Redirect / Phishing Enabler |
| Authentication | None Required |
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.
A critical stored Cross-Site Scripting (XSS) vulnerability was identified in Froxlor server administration software panel before version 2.3.8. Authenticated customers with DNS editor privileges can inject malicious JavaScript into DNS TXT records. Because the application processes these values via a raw formatting callback without context-aware HTML entity encoding, the payload executes in the security context of administrative users who view the affected domain's DNS zones.
An authenticated administrator with privileges to manage admin accounts (such as change_serversettings) can execute arbitrary SQL commands via a second-order SQL injection vulnerability. The flaw resides in Froxlor's administrative API endpoints, specifically during the handling of IP address mapping parameters which are stored as serialized arrays and later interpolated without sanitization into active database queries. This vulnerability allows high-privileged administrative attackers to compromise the database. By injecting a payload into administrative profile metadata, an attacker can extract sensitive credentials, manipulate backend settings, or potentially disrupt database integrity. The vulnerability affects all versions of Froxlor prior to 2.3.8.
CVE-2026-54543 is a DNS Resource Record (RR) Injection vulnerability in Froxlor, an open-source server administration control panel. Prior to version 2.3.8, the DomainZones.add API command failed to perform strict sanitization and validation on the user-controlled record (label) and type parameters before serializing them into BIND-compatible zone files. An authenticated customer with DNS zone management permissions can inject control characters, breaking out of the original record context to define unauthorized resource records within managed zones.
CVE-2026-42533 is a critical security vulnerability discovered in NGINX Open Source, NGINX Plus, NGINX Ingress Controller, and related products, referred to as the 'Two-Pass Capture-Clobbering' bug. The flaw is situated within NGINX's internal evaluation engine when handling complex variables, exposing a heap-based buffer overflow and information leak when a configuration chains regular expression-based map directives with numbered capture groups. An unauthenticated remote attacker can exploit this weakness by transmitting crafted HTTP requests to trigger remote code execution or defeat ASLR.
Froxlor prior to version 2.3.8 contains a high-severity architectural flaw where the standalone lib/ajax.php entry point bypasses the centralized request validation in lib/init.php. Unauthenticated remote attackers can leverage Cross-Site Request Forgery (CSRF) to induce authenticated administrators to submit forged requests that modify API key whitelists and expiration dates, potentially yielding persistent, out-of-band administrative control.
An insecure data retrieval flaw in the Froxlor server administration panel API allows authenticated remote attackers to retrieve unredacted bcrypt password hashes and Base32-encoded Time-Based One-Time Password (TOTP) seeds. Affected endpoints include several 'get' and 'listing' handlers for customers, administrators, and FTP accounts. Utilizing these leaked parameters, attackers can crack the password hashes offline and concurrently generate valid second-factor authentication codes to completely bypass access controls.