Skip to main content
Vulnerability Database/CVE-2026-114139

CVE-2026-114139: Sentry JavaScript SDK Auth Bypass Vulnerability

CVE-2026-114139 is an authentication bypass flaw in Sentry JavaScript SDK that allows unauthenticated requests to reach protected routes. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-114139 Overview

CVE-2026-114139 is an authorization bypass vulnerability in the @sentry/nextjs SDK affecting the webpack integration. The flaw stems from a mismatch between how the Sentry middleware wrapper identifies tunnel requests and how the tunnel rewrite rule actually serves them. When an application configures tunnelRoute and a webpack build is used, the middleware wrapper skips user middleware for any path under the tunnel route. If an application route collides with the tunnel path or a root dynamic segment resolves beneath it, an unauthenticated attacker can reach that route without any middleware authorization checks. The issue is tracked as [CWE-693: Protection Mechanism Failure] and is fixed in versions 9.47.2, 10.75.2, and 11.0.0-rc.1.

Critical Impact

Unauthenticated network attackers can bypass Next.js middleware authorization and reach protected application routes when tunnelRoute is configured and middleware is the sole access control.

Affected Products

  • @sentry/nextjs versions 9.36.0 through 9.47.1
  • @sentry/nextjs versions 10.x prior to 10.75.2
  • @sentry/nextjs versions 11.0.0-rc.0 and earlier release candidates

Discovery Timeline

  • 2026-10-21 - CVE-2026-114139 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-114139

Vulnerability Analysis

The Sentry Next.js SDK supports a tunnelRoute option that proxies telemetry through the application origin to bypass ad blockers. Next.js rewrites requests matching the exact tunnel path with valid o and p query parameters to Sentry. The SDK also wraps user middleware so that tunnel traffic skips middleware execution.

The defect is scope mismatch. The middleware wrapper used isPathnameUnderSentryTunnelRoute, which matched the tunnel path and any descendant path. The rewrite rule only matched the exact tunnel path with specific numeric query parameters. Requests under the tunnel path that the rewrite did not serve still bypassed middleware and reached the application.

Root Cause

The middleware exclusion predicate was broader than the rewrite predicate. Any request whose pathname began with the configured tunnel route caused wrapMiddlewareWithSentry to short-circuit, skipping authorization logic implemented by the developer. Application routes colliding with the tunnel route, or root-level dynamic segments resolving beneath it, became reachable without middleware enforcement.

Attack Vector

An unauthenticated remote attacker sends an HTTP request to a route that resolves under the configured tunnelRoute prefix. The Sentry wrapper identifies the request as tunnel traffic and skips the middleware chain. If middleware was the only control enforcing authentication or authorization, the attacker reaches the route handler directly.

typescript
// Patched predicate from packages/nextjs/src/common/utils/tunnelPathnameMatch.ts
export function isSentryTunnelRequest(request: Request, tunnelPath: string): boolean {
  // The SDK transport only ever sends POST requests
  if (request.method !== 'POST') {
    return false;
  }

  const url = new URL(request.url);

  if (url.pathname !== tunnelPath && url.pathname !== `${tunnelPath}/`) {
    return false;
  }

  // Next.js evaluates `has` conditions against the last value of a repeated query param,
  // so every value has to qualify
  return ['o', 'p'].every(key => {
    const values = url.searchParams.getAll(key);
    return values.length > 0 && values.every(value => /^\d+$/.test(value));
  });
}

Source: Sentry JavaScript Commit 878b685

The fix narrows the middleware-skip predicate so it only excludes requests the rewrite would actually serve: POST method, exact pathname match, and numeric o and p query parameters.

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-114139

Indicators of Compromise

  • Non-POST requests (GET, PUT, DELETE) targeting paths under the configured tunnelRoute in web server or CDN logs.
  • Requests to the tunnel route path missing numeric o and p query string parameters.
  • Access log entries showing successful responses from application routes that collide with the tunnel path without preceding authentication events.

Detection Strategies

  • Enumerate the application route tree and compare against the configured tunnelRoute value to identify colliding routes or root dynamic segments.
  • Review middleware logs for gaps where expected authorization checks did not execute despite requests reaching protected handlers.
  • Audit the installed @sentry/nextjs version in package-lock.json or yarn.lock against fixed versions 9.47.2, 10.75.2, and 11.0.0-rc.1.

Monitoring Recommendations

  • Alert on HTTP methods other than POST reaching paths under the tunnelRoute prefix at the edge or reverse proxy.
  • Instrument the application to log every middleware entry and exit so skipped middleware can be correlated to downstream route access.
  • Monitor Sentry ingest telemetry for anomalous request shapes that do not match legitimate SDK transport patterns.

How to Mitigate CVE-2026-114139

Immediate Actions Required

  • Upgrade @sentry/nextjs to 9.47.2, 10.75.2, or 11.0.0-rc.1 depending on the major version in use.
  • Audit application routes for any collision with the configured tunnelRoute and relocate conflicting routes.
  • Add defense-in-depth authorization at the route handler level so middleware is not the sole access control.

Patch Information

The vulnerability is fixed in @sentry/nextjs releases 9.47.2, 10.75.2, and 11.0.0-rc.1. The patches replace isPathnameUnderSentryTunnelRoute with the stricter isSentryTunnelRequest predicate in wrapMiddlewareWithSentry. Reference commits: 878b685, c122aac4, and d525a2f. Full details are in the GHSA-mchm-gjx6-7h55 advisory.

Workarounds

  • Remove the tunnelRoute option from the Sentry Next.js configuration until upgrade is possible.
  • Choose a tunnelRoute value that cannot collide with any application route or root dynamic segment.
  • Enforce authentication and authorization inside each route handler rather than relying exclusively on middleware.
bash
# Update to a patched release
npm install @sentry/nextjs@9.47.2
# or
npm install @sentry/nextjs@10.75.2
# or
npm install @sentry/nextjs@11.0.0-rc.1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.