CVE-2026-3125: CWE-918 Server-Side Request Forgery (SSRF) in opennextjs @opennextjs/cloudflare
A Server-Side Request Forgery (SSRF) vulnerability was identified in the @opennextjs/cloudflare package, resulting from a path normalization bypass in the /cdn-cgi/image/ handler.The @opennextjs/cloudflare worker template includes a /cdn-cgi/image/ handler intended for development use only. In production, Cloudflare's edge intercepts /cdn-cgi/image/ requests before they reach the Worker. However, by substituting a backslash for a forward slash (/cdn-cgi\image/ instead of /cdn-cgi/image/), an attacker can bypass edge interception and have the request reach the Worker directly. The JavaScript URL class then normalizes the backslash to a forward slash, causing the request to match the handler and trigger an unvalidated fetch of arbitrary remote URLs. For example: https://victim-site.com/cdn-cgi\image/aaaa/https://attacker.com In this example, attacker-controlled content from attacker.com is served through the victim site's domain (victim-site.com), violating the same-origin policy and potentially misleading users or other services. Note: This bypass only works via HTTP clients that preserve backslashes in paths (e.g., curl --path-as-is). Browsers normalize backslashes to forward slashes before sending requests. Additionally, Cloudflare Workers with Assets and Cloudflare Pages suffer from a similar vulnerability. Assets stored under /cdn-cgi/ paths are not publicly accessible under normal conditions. However, using the same backslash bypass (/cdn-cgi\... instead of /cdn-cgi/...), these assets become publicly accessible. This could be used to retrieve private data. For example, Open Next projects store incremental cache data under /cdn-cgi/_next_cache, which could be exposed via this bypass.
AI Analysis
Technical Summary
CVE-2026-3125 is a Server-Side Request Forgery (SSRF) vulnerability identified in the @opennextjs/cloudflare package, specifically within the /cdn-cgi/image/ handler. The root cause is a path normalization bypass that occurs when an attacker replaces the forward slash (/) with a backslash (\) in the URL path (e.g., /cdn-cgi\image/ instead of /cdn-cgi/image/). Normally, Cloudflare's edge intercepts requests to /cdn-cgi/image/ and prevents them from reaching the Worker in production environments. However, the backslash substitution bypasses this interception because some HTTP clients preserve backslashes in the path, allowing the request to reach the Worker directly. Once the Worker receives the request, the JavaScript URL class normalizes the backslash back to a forward slash, causing the request to match the handler and trigger an unvalidated fetch of arbitrary remote URLs controlled by the attacker. This enables SSRF attacks where attacker-controlled content is served through the victim's domain, violating the same-origin policy and potentially misleading users or other services relying on domain-based trust. Furthermore, a similar bypass affects Cloudflare Workers with Assets and Cloudflare Pages, where assets stored under /cdn-cgi/ paths are normally inaccessible publicly. Using the backslash bypass, these assets, including sensitive incremental cache data stored under /cdn-cgi/_next_cache, can be accessed publicly, risking exposure of private data. The vulnerability requires no authentication or user interaction but depends on the HTTP client preserving backslashes in the URL path, limiting exploitation vectors primarily to tools like curl with --path-as-is. No patches or exploits in the wild are currently reported, but the vulnerability is rated high severity with a CVSS 4.0 score of 7.7 due to its potential impact on confidentiality and integrity.
Potential Impact
This vulnerability poses significant risks to organizations using the @opennextjs/cloudflare package, Cloudflare Workers with Assets, or Cloudflare Pages. The SSRF flaw allows attackers to make the vulnerable server fetch arbitrary remote URLs, potentially leading to unauthorized data access, information disclosure, or use of the victim domain to serve malicious content, undermining user trust and violating same-origin policy protections. The exposure of private assets stored under /cdn-cgi/ paths can lead to leakage of sensitive incremental cache data or other confidential files, which may contain proprietary or user data. This can facilitate further attacks such as credential theft, data exfiltration, or phishing by serving attacker-controlled content from trusted domains. The vulnerability requires no authentication or user interaction, increasing the risk of automated exploitation by attackers with network access to the vulnerable endpoints. Although exploitation is limited to HTTP clients that preserve backslashes, this includes common command-line tools used in penetration testing and automated attack frameworks. The widespread use of Cloudflare services and the @opennextjs/cloudflare package in modern web applications means that many organizations globally could be affected, especially those relying on Cloudflare Workers and Pages for content delivery and caching. The impact extends to confidentiality and integrity of data and services, with moderate impact on availability since the vulnerability does not directly cause denial of service.
Mitigation Recommendations
Organizations should immediately audit their use of the @opennextjs/cloudflare package and Cloudflare Workers or Pages that utilize /cdn-cgi/image/ or /cdn-cgi/ asset paths. Specific mitigations include: 1) Implement strict input validation and normalization on URL paths to reject or correctly handle backslash characters before processing requests, preventing path normalization bypass. 2) Configure Cloudflare edge rules or firewall policies to detect and block requests containing backslashes in URL paths, especially those targeting /cdn-cgi/ endpoints. 3) Avoid using the vulnerable /cdn-cgi/image/ handler in production environments or replace it with a hardened alternative that does not rely on path matching vulnerable to backslash bypass. 4) Restrict access to sensitive assets and cache directories by enforcing authentication or token-based access controls rather than relying solely on obscurity or path restrictions. 5) Monitor logs for suspicious requests containing backslashes or unusual access patterns to /cdn-cgi/ paths. 6) Stay updated with vendor patches or security advisories from opennextjs and Cloudflare and apply fixes promptly once available. 7) Educate developers and DevOps teams about the risks of path normalization issues and SSRF to prevent similar vulnerabilities in custom code. These targeted actions go beyond generic SSRF mitigations by addressing the unique path normalization bypass vector and Cloudflare-specific behaviors.
Affected Countries
United States, Germany, United Kingdom, France, Japan, South Korea, Australia, Canada, Netherlands, Singapore
CVE-2026-3125: CWE-918 Server-Side Request Forgery (SSRF) in opennextjs @opennextjs/cloudflare
Description
A Server-Side Request Forgery (SSRF) vulnerability was identified in the @opennextjs/cloudflare package, resulting from a path normalization bypass in the /cdn-cgi/image/ handler.The @opennextjs/cloudflare worker template includes a /cdn-cgi/image/ handler intended for development use only. In production, Cloudflare's edge intercepts /cdn-cgi/image/ requests before they reach the Worker. However, by substituting a backslash for a forward slash (/cdn-cgi\image/ instead of /cdn-cgi/image/), an attacker can bypass edge interception and have the request reach the Worker directly. The JavaScript URL class then normalizes the backslash to a forward slash, causing the request to match the handler and trigger an unvalidated fetch of arbitrary remote URLs. For example: https://victim-site.com/cdn-cgi\image/aaaa/https://attacker.com In this example, attacker-controlled content from attacker.com is served through the victim site's domain (victim-site.com), violating the same-origin policy and potentially misleading users or other services. Note: This bypass only works via HTTP clients that preserve backslashes in paths (e.g., curl --path-as-is). Browsers normalize backslashes to forward slashes before sending requests. Additionally, Cloudflare Workers with Assets and Cloudflare Pages suffer from a similar vulnerability. Assets stored under /cdn-cgi/ paths are not publicly accessible under normal conditions. However, using the same backslash bypass (/cdn-cgi\... instead of /cdn-cgi/...), these assets become publicly accessible. This could be used to retrieve private data. For example, Open Next projects store incremental cache data under /cdn-cgi/_next_cache, which could be exposed via this bypass.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-3125 is a Server-Side Request Forgery (SSRF) vulnerability identified in the @opennextjs/cloudflare package, specifically within the /cdn-cgi/image/ handler. The root cause is a path normalization bypass that occurs when an attacker replaces the forward slash (/) with a backslash (\) in the URL path (e.g., /cdn-cgi\image/ instead of /cdn-cgi/image/). Normally, Cloudflare's edge intercepts requests to /cdn-cgi/image/ and prevents them from reaching the Worker in production environments. However, the backslash substitution bypasses this interception because some HTTP clients preserve backslashes in the path, allowing the request to reach the Worker directly. Once the Worker receives the request, the JavaScript URL class normalizes the backslash back to a forward slash, causing the request to match the handler and trigger an unvalidated fetch of arbitrary remote URLs controlled by the attacker. This enables SSRF attacks where attacker-controlled content is served through the victim's domain, violating the same-origin policy and potentially misleading users or other services relying on domain-based trust. Furthermore, a similar bypass affects Cloudflare Workers with Assets and Cloudflare Pages, where assets stored under /cdn-cgi/ paths are normally inaccessible publicly. Using the backslash bypass, these assets, including sensitive incremental cache data stored under /cdn-cgi/_next_cache, can be accessed publicly, risking exposure of private data. The vulnerability requires no authentication or user interaction but depends on the HTTP client preserving backslashes in the URL path, limiting exploitation vectors primarily to tools like curl with --path-as-is. No patches or exploits in the wild are currently reported, but the vulnerability is rated high severity with a CVSS 4.0 score of 7.7 due to its potential impact on confidentiality and integrity.
Potential Impact
This vulnerability poses significant risks to organizations using the @opennextjs/cloudflare package, Cloudflare Workers with Assets, or Cloudflare Pages. The SSRF flaw allows attackers to make the vulnerable server fetch arbitrary remote URLs, potentially leading to unauthorized data access, information disclosure, or use of the victim domain to serve malicious content, undermining user trust and violating same-origin policy protections. The exposure of private assets stored under /cdn-cgi/ paths can lead to leakage of sensitive incremental cache data or other confidential files, which may contain proprietary or user data. This can facilitate further attacks such as credential theft, data exfiltration, or phishing by serving attacker-controlled content from trusted domains. The vulnerability requires no authentication or user interaction, increasing the risk of automated exploitation by attackers with network access to the vulnerable endpoints. Although exploitation is limited to HTTP clients that preserve backslashes, this includes common command-line tools used in penetration testing and automated attack frameworks. The widespread use of Cloudflare services and the @opennextjs/cloudflare package in modern web applications means that many organizations globally could be affected, especially those relying on Cloudflare Workers and Pages for content delivery and caching. The impact extends to confidentiality and integrity of data and services, with moderate impact on availability since the vulnerability does not directly cause denial of service.
Mitigation Recommendations
Organizations should immediately audit their use of the @opennextjs/cloudflare package and Cloudflare Workers or Pages that utilize /cdn-cgi/image/ or /cdn-cgi/ asset paths. Specific mitigations include: 1) Implement strict input validation and normalization on URL paths to reject or correctly handle backslash characters before processing requests, preventing path normalization bypass. 2) Configure Cloudflare edge rules or firewall policies to detect and block requests containing backslashes in URL paths, especially those targeting /cdn-cgi/ endpoints. 3) Avoid using the vulnerable /cdn-cgi/image/ handler in production environments or replace it with a hardened alternative that does not rely on path matching vulnerable to backslash bypass. 4) Restrict access to sensitive assets and cache directories by enforcing authentication or token-based access controls rather than relying solely on obscurity or path restrictions. 5) Monitor logs for suspicious requests containing backslashes or unusual access patterns to /cdn-cgi/ paths. 6) Stay updated with vendor patches or security advisories from opennextjs and Cloudflare and apply fixes promptly once available. 7) Educate developers and DevOps teams about the risks of path normalization issues and SSRF to prevent similar vulnerabilities in custom code. These targeted actions go beyond generic SSRF mitigations by addressing the unique path normalization bypass vector and Cloudflare-specific behaviors.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- cloudflare
- Date Reserved
- 2026-02-24T14:15:54.385Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69a87af1d1a09e29cb563d8c
Added to database: 3/4/2026, 6:33:21 PM
Last enriched: 3/11/2026, 8:22:39 PM
Last updated: 4/18/2026, 10:18:16 PM
Views: 209
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.