OpenNext Cloudflare: Cache interception can bypass middleware protection for encoded paths
Summary
When cache interception is enabled, @opennextjs/cloudflare can interpret percent-encoded paths differently during middleware matching and cache lookup.
An encoded request may fail to match authorization middleware, then be decoded into the cache key of a protected route. The cached response may consequently be returned without invoking the middleware.
enableCacheInterception is disabled by default.
Impact
A remote unauthenticated attacker may retrieve cached content from routes intended to be protected by middleware.
An application is affected when it:
- explicitly enables
enableCacheInterception; - relies on middleware for access control; and
- has a matching cached route.
Details
Middleware matching previously used the encoded request pathname, while cache interception decoded the pathname before selecting a cache entry.
For example, consider an application with:
- middleware matcher
/admin/:path*; - middleware returning
401 Authentication requiredfor/admin; - a statically generated, cached
/adminroute; and - cache interception enabled:
export default defineCloudflareConfig({
incrementalCache: staticAssetsIncrementalCache,
enableCacheInterception: true,
});
An attacker can request:
GET /%61dmin
The encoded pathname does not match /admin/:path*, so the authorization middleware is not invoked. Cache interception then decodes %61dmin to admin and may return the cached /admin response:
HTTP/1.1 200 OK
x-opennext-cache: HIT
Protected content
Malformed paths exposed an additional inconsistency. For example:
GET /%61dmin/%ZZ
The previous implementation decoded each segment independently. It decoded %61dmin to admin but retained the malformed %ZZ segment, allowing cache lookup to continue using a partially decoded pathname.
Patches
The fix aligns encoded-path handling across middleware matching and cache lookup, and rejects malformed paths instead of partially decoding them. See the upstream fixes in opennextjs-aws#1199 and opennextjs-aws#1200.
Users should upgrade to @opennextjs/cloudflare@1.20.2 or later.
What to do
Upgrade to @opennextjs/cloudflare@1.20.2 or later. If upgrading is not immediately possible, consider the following workarounds:
- Disable cache interception by removing
enableCacheInterception: true. - Enforce authorization inside protected route handlers rather than relying exclusively on middleware.
- Reject encoded paths for protected routes at a trusted proxy before they reach the Worker.
Adding individual encoded matcher variants is not a complete workaround because pathnames can have multiple equivalent encodings.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | @opennextjs/cloudflare | >= 0.3.0, < 1.20.2 | 1.20.2 |
References
- https://github.com/opennextjs/opennextjs-cloudflare/security/advisories/GHSA-2vc4-c4r6-p6v6
- https://nvd.nist.gov/vuln/detail/CVE-2026-100409
- https://github.com/opennextjs/opennextjs-aws/pull/1199
- https://github.com/opennextjs/opennextjs-aws/pull/1200
- https://github.com/opennextjs/opennextjs-cloudflare/commit/38ea40b669be272ddf09a7df7e70c69d0b57404b
- https://github.com/opennextjs/opennextjs-cloudflare
- https://github.com/opennextjs/opennextjs-cloudflare/releases/tag/@opennextjs/cloudflare@1.20.2
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N- Weakness (CWE)
CWE-177, CWE-180- Platform
- npm
- Package
@opennextjs/cloudflare- Disclosed
- 15.10.2026
- Updated
- 16.10.2026 08:00
Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.
OSV / GitHub Advisory Database - GHSA-2vc4-c4r6-p6v6 - CC BY 4.0
Vulnerability history: @opennextjs/cloudflare
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 2
- First → latest
- 06.2025 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 2
Disclosures per year
- 2025: 1
- 2026: 1
-
OpenNext Cloudflare: Cache interception can bypass middleware protection for encoded paths this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.