All posts

@sentry/nextjs’s tunnelRoute bypass: can your middleware be skipped?

CVE-2026-114139 (CVSS 9.1) can let requests skip Next.js middleware when @sentry/nextjs tunnelRoute is set on a webpack build. Who is affected, and the fix.

Published
Reading time
6 min
By
Girish Babu GV

What happened#

@sentry/nextjs has an option called tunnelRoute. It sends the browser SDK’s reports through a path on your own domain so ad blockers are less likely to drop them. According to Sentry’s advisory, the webpack integration makes Next.js skip your application middleware for every request under that path, so Sentry’s report requests aren’t blocked. The rewrite that forwards reports to Sentry, though, only handles the exact tunnel path with valid o and p query parameters. The skip is broader than the rewrite.

The advisory says that gap lets other requests under the tunnel path reach your application without middleware ever running. It stresses a limit: skipping middleware grants no privileges by itself, and routes that check the session on the server are still protected. Sentry’s own services and organisation data are not affected.

The CVE record (reserved 20 October and published 21 October 2026, with GitHub as the CNA) rates it Critical, CVSS 4.0 base score 9.1, weakness CWE-693 (protection mechanism failure). It also carries a CISA enrichment entry that lists exploitation as “none”, automatable as “yes” and technical impact as “total”. That entry reflects CISA’s assessment on 28 October; it doesn’t describe any observed attack. GitHub’s Advisory Database lists the same issue as Critical. One note of caution: when I fetched Sentry’s own advisory page, the summary I got labelled it “moderate” and gave a publication date of 24 September, which doesn’t match the CVE record, so treat the severity label as something to confirm on the advisory itself.

Key facts from the advisory and CVE record
ItemValue
CVE / advisoryCVE-2026-114139 / GHSA-mchm-gjx6-7h55
Package@sentry/nextjs (npm)
Affected9.36.0 to before 9.47.2; 10.0.0-alpha.0 to before 10.75.2; 11.0.0-alpha.0 to before 11.0.0-rc.1
Patched9.47.2, 10.75.2, 11.0.0-rc.1
Severity in the CVE recordCritical, CVSS 4.0 base score 9.1
WeaknessCWE-693, protection mechanism failure

The fix, per the 10.75.2 release notes, is a change that “aligns tunnel request matching in middleware with the tunnel rewrite” (pull request #24565). In other words, middleware is skipped only for requests the tunnel really serves.

Am I affected?#

The advisory says all four must hold. If any one is false, it does not list you as exposed.

What has to be true (all four)
ConditionWhere to look
tunnelRoute is setThe Sentry options in next.config (withSentryConfig)
The app is built with webpack, not TurbopackYour build script and next.config; the advisory says Turbopack builds are not affected
A route of yours resolves under the tunnel path, by direct collision or via a root dynamic segment such as app/[locale]Your app/ directory against the tunnelRoute value
Middleware is the only place that enforces authorization for that routemiddleware (or proxy) file versus checks in routes, layouts and data access

You also need to be on a version older than the fixed ones listed above.

What to do now#

  1. Check the version and the option. Find out which @sentry/nextjs is installed and whether tunnelRoute is set.
  2. Upgrade to 9.47.2, 10.75.2 or 11.0.0-rc.1 or later on your line. The advisory says no configuration change is needed.
  3. Check authorization lives in the route, not only in middleware. The advisory’s own workaround list includes enforcing authorization in routes, layouts or the data-access layer in addition to middleware.
  4. If you can’t upgrade today, the advisory lists these workarounds: choose a tunnel path that no route can resolve under, remove tunnelRoute, or build with Turbopack.
Check, then update
# Which version is installed?
npm ls @sentry/nextjs

# Is tunnelRoute set? (look in your Next config)
grep -rn "tunnelRoute" next.config.*

# Upgrade within your major line, then deploy
npm install @sentry/nextjs@latest

What the sources don’t say#

  • Whether anyone has exploited this. The advisory doesn’t say; CISA’s enrichment lists exploitation as “none” as of 28 October.
  • How many apps combine tunnelRoute with a colliding route and middleware-only checks. No numbers are given.
  • The advisory credits and the exact dates were not fully visible in what I fetched, and the severity label differed between pages, as noted above.

My take#

My own opinion, not from the advisory.

Middleware is convenient for a first line of defence, but a bug like this is a reminder that it is a routing layer, and routing layers have gaps. Checking the session where the data is read costs a few lines and means a skipped middleware is an inconvenience rather than a breach. It is also worth noting how narrow the conditions are; for most Sentry users this will not apply, and it takes five minutes to confirm.

Sources#

Keep reading

Esc