GHSA-2vc4-c4r6-p6v6: High severity npm/@opennextjs/cloudflare vulnerability

Published Oct 15, 2026
·
Updated

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 required for /admin; - a statically generated, cached /admin route; and - cache interception enabled:

ts export default defineCloudflareConfig({ incrementalCache: staticAssetsIncrementalCache, enableCacheInterception: true, });

An attacker can request:

http 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 HTTP/1.1 200 OK x-opennext-cache: HIT

Protected content

Malformed paths exposed an additional inconsistency. For example:

http 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.

Workarounds

If upgrading is not immediately possible for an application:

1. Disable cache interception by removing enableCacheInterception: true. 2. Enforce authorization inside protected route handlers rather than relying exclusively on middleware. 3. 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

1 affected componentFixes available
npm/@opennextjs/cloudflare>=0.3.0<1.20.2
1.20.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@opennextjs/cloudflare to a version that resolves this vulnerability.

    Fixed in 1.20.2
  2. Upgrade

    Upgrade @opennextjs/cloudflare to a version that resolves this vulnerability.

    Fixed in 1.20.2
  3. Configuration

    Disable cache interception by removing or setting enableCacheInterception: true to false.

    @opennextjs/cloudflare enableCacheInterception = false
  4. Configuration

    Enforce authorization inside protected route handlers rather than relying exclusively on middleware.

    Protected route handlers authorization = enforced inside route handlers
  5. Compensating control

    Reject encoded paths for protected routes at a trusted proxy before they reach the Worker.

Event History

Oct 15, 2026
Advisory Published
via GitHub·08:15 PM
Data Sourced
via GitHub·08:15 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are affected?

An application is affected only if it explicitly enables enableCacheInterception, uses middleware for access control, and has a matching route whose response is cached. Cache interception is disabled by default.

2

What does an attacker need to exploit this issue?

A remote unauthenticated attacker needs to send a percent-encoded path that avoids the middleware matcher but decodes to the cache key of a protected cached route. No credentials or user interaction are required.

3

What is exposed if exploitation succeeds?

Cached content from routes intended to be protected by middleware may be returned without the middleware running. The described impact is disclosure of cached protected content; integrity and availability impacts are not indicated.

4

What can be done if patching is not immediately possible?

Disable enableCacheInterception. This removes the explicitly enabled condition required for the described exposure.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203