---
id: "CVE-2026-114139"
kind: "vulnerability"
aliases: ["CVE-2026-114139", "GHSA-mchm-gjx6-7h55"]
title: "Sentry-Javascript: Middleware Bypass when using Tunnel route"
severity: "critical"
cvss: 9.1
epss: 0.0040699997916817665
exploited: false
status: "open"
category: "package"
products: [{"name": "@sentry/nextjs", "fixed": ["9.47.2"], "affected": ">= 9.36.0, < 9.47.2", "ecosystem": "npm"}, {"name": "@sentry/nextjs", "fixed": ["10.75.2"], "affected": ">= 10.0.0-alpha.0, < 10.75.2", "ecosystem": "npm"}, {"name": "@sentry/nextjs", "fixed": ["11.0.0-rc.1"], "affected": ">= 11.0.0-alpha.0, < 11.0.0-rc.1", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-693", "next.js", "package", "self-hosted", "sentry", "webpack"]
not_affected_if: ["auth-enforced-in-route", "managed-hosting", "tunnelroute-unset", "turbopack-build"]
published_at: "2026-10-21T21:17:56+00:00"
first_seen_at: "2026-10-23T19:11:32+00:00"
updated_at: "2026-10-23T21:57:29+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-mchm-gjx6-7h55", "first_seen_at": "2026-10-23T19:11:32+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-114139", "first_seen_at": "2026-10-23T21:57:29+00:00"}]
---

# Sentry-Javascript: Middleware Bypass when using Tunnel route

The @sentry/nextjs SDK skipped Next.js middleware for every path under the tunnelRoute prefix, not just the requests the tunnel rewrite serves. An attacker can reach application routes that sit under that prefix without the middleware running, so any authorization enforced only in middleware is bypassed.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:@sentry/nextjs affected >= 9.36.0, < 9.47.2 fixed 9.47.2
- npm:@sentry/nextjs affected >= 10.0.0-alpha.0, < 10.75.2 fixed 10.75.2
- npm:@sentry/nextjs affected >= 11.0.0-alpha.0, < 11.0.0-rc.1 fixed 11.0.0-rc.1

## How to check

Check whether next.config or the Sentry init sets tunnelRoute, and whether the app is built with webpack (not Turbopack).
List app routes under the tunnel path, including dynamic segments at the root such as app/[locale]/, and confirm whether middleware is the only authorization check for them.
Run npm ls @sentry/nextjs to see the installed version.

## Fix

Upgrade @sentry/nextjs to 9.47.2, 10.75.2 or 11.0.0-rc.1 depending on major version. No config change is needed after upgrading.
Until upgraded, change tunnelRoute to a path no route can resolve under, remove it, build with Turbopack, or enforce authorization in route handlers, layouts and data access as well as middleware.

## Timeline

- 2026-10-23T19:11:32+00:00 ghsa https://github.com/advisories/GHSA-mchm-gjx6-7h55
- 2026-10-23T21:57:29+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-114139

## From the sources

### Impact

The `tunnelRoute` option makes the SDK send browser events to a path on your own Next.js server (for example `/monitoring`), where a rewrite forwards them to Sentry to prevent ad blockers from blocking them. To keep those envelope requests from being rejected by your middleware, the SDK skips middleware for them.

The middleware skip was wider than the rewrite. The rewrite only serves requests to the tunnel path itself with the `o` and `p` parameters set. The skip applied to anything under the tunnel path. Requests in that gap go to your application instead of Sentry, and your middleware never runs on them.

Skipping middleware does not grant the request any privileges. Routes that check the session server-side are still protected.

You are affected only if **all** of the following are true:

1. `tunnelRoute` is set (a string path or `true`),
2. your app is built with **webpack** (Turbopack builds are not affected),
3. some route of your application resolves under the tunnel path. That could be a direct collision (`/monitoring/foo` with `tunnelRoute: '/monitoring'`) or a dynamic segment at the route root (`app/[locale]/…`), which matches any first path segment, and
4. your middleware is the only place that enforces authorization for those routes.

Sentry's own services, and the data in your Sentry organization, are not affected.

### Patches

Fixed in [9.47.2](https://github.com/getsentry/sentry-javascript/releases/tag/9.47.2), [10.75.2](https://github.com/getsentry/sentry-javascript/releases/tag/10.75.2) and [11.0.0-rc.1](https://github.com/getsentry/sentry-javascript/releases/tag/11.0.0-rc.1). The skip now matches only the requests the tunnel rewrite actually serves. No configuration change is needed.

### Workarounds

- Set `tunnelRoute` to a path no route of yours can resolve under, or remove the option.
- Build with Turbopack (default for `next build` from Next.js 16).
- Enforce authorization in the route, layout or data-access path as well as in middleware.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
