Skip to content

feat(nuxt, nitro): Serve the managed tunnel before the app's server middleware - #25418

Draft
logaretm wants to merge 2 commits into
awad/tunnel-sveltekitfrom
awad/tunnel-nitro
Draft

logaretm wants to merge 2 commits into
awad/tunnel-sveltekitfrom
awad/tunnel-nitro

Conversation

@logaretm

@logaretm logaretm commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

A Nitro app's own server/middleware, like an auth check, ran before anything Sentry registered and would block tunnel requests, fixed by putting the tunnel check first in h3's middleware on Nitro v3 and answering from the request hook on Nitro v2.

The e2e tunnel variants for Nuxt 4, Nuxt 5 and Nitro 3 check that the tunnel answers while an auth middleware rejects every other POST.

closes #20254

@logaretm
logaretm added this pull request to stack #25201 October 15, 2026 15:51
return;
}

const tunnelResponse = handleTunnelRequestIfMatched(toWebRequest(event));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High severity and reachable issue identified in your code:
Line 16 has a potentially vulnerable usage of h3, possibly introducing a high severity vulnerability.

ℹ️ Why this is reachable

A reachable issue is a possible security risk because your project actually executes the vulnerable code. This issue is reachable because your code calls vulnerable code in this version of h3.
Affected versions of h3 are vulnerable to Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'). The readRawBody function in h3 performs a strict, case-sensitive check for "chunked" in the Transfer-Encoding header. If an attacker sends a mixed-case value (e.g. "Transfer-Encoding: ChuNked") and no Content-Length, h3 will assume an empty body, immediately process the request, and leave the real payload data on the socket. When h3 is deployed behind a Layer 4 proxy (such as AWS NLB or raw TCP proxies that don't normalize headers), this enables a classic TE.TE HTTP request smuggling attack—allowing an attacker to bypass WAFs or desynchronize and poison other users' connections.

References: https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-2737, GHSA, CVE

To resolve this comment:
Upgrade this dependency to at least version 1.15.5 at yarn.lock.

💬 Ignore this finding

To ignore this, reply with:

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

You can view more details on this finding in the Semgrep AppSec Platform here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to do in an external PR.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.72 kB +2.82% +840 B 🔺
@sentry/browser - with treeshaking flags 28.58 kB +2% +560 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 28.47 kB +1.96% +547 B 🔺
@sentry/browser (incl. Tracing) 52.9 kB +1.59% +826 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 52.9 kB +1.58% +821 B 🔺
@sentry/browser (incl. Tracing, Profiling) 55.83 kB +1.48% +812 B 🔺
@sentry/browser (incl. Tracing, Replay) 92.65 kB +0.91% +832 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.21 kB +0.66% +526 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 97.39 kB +0.88% +845 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 110.32 kB +0.77% +835 B 🔺
@sentry/browser (incl. Feedback) 48.24 kB +1.8% +849 B 🔺
@sentry/browser (incl. sendFeedback) 35.8 kB +2.47% +861 B 🔺
@sentry/browser (incl. FeedbackAsync) 40.9 kB +2.13% +851 B 🔺
@sentry/browser (incl. Metrics) 31.69 kB +2.56% +790 B 🔺
@sentry/browser (incl. Logs) 31.98 kB +2.58% +803 B 🔺
@sentry/browser (incl. Metrics & Logs) 32.69 kB +2.76% +877 B 🔺
@sentry/react 32.51 kB +2.57% +812 B 🔺
@sentry/react (incl. Tracing) 55.18 kB +1.47% +795 B 🔺
@sentry/vue 38.86 kB +2.16% +821 B 🔺
@sentry/vue (incl. Tracing) 55.84 kB +1.53% +838 B 🔺
@sentry/svelte 30.75 kB +2.84% +848 B 🔺
@sentry/remix (Remix 3 client bundle) 57.95 kB +1.52% +862 B 🔺
CDN Bundle 32.11 kB +1.49% +469 B 🔺
CDN Bundle (incl. Tracing) 53.07 kB +0.94% +492 B 🔺
CDN Bundle (incl. Logs, Metrics) 34.31 kB +1.42% +479 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 55.02 kB +0.91% +492 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 75.25 kB +0.65% +485 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.75 kB +0.56% +505 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.73 kB +0.6% +553 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.87 kB +0.49% +471 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.91 kB +0.58% +564 B 🔺
CDN Bundle - uncompressed 94.41 kB +1.32% +1.23 kB 🔺
CDN Bundle (incl. Tracing) - uncompressed 157.25 kB +0.78% +1.22 kB 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.95 kB +1.24% +1.23 kB 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.21 kB +0.76% +1.22 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 230.99 kB +0.54% +1.23 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 277.42 kB +0.45% +1.22 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 283.36 kB +0.44% +1.22 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 291.12 kB +0.42% +1.22 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 297.05 kB +0.42% +1.22 kB 🔺
@sentry/nextjs (client) 57.61 kB +1.43% +812 B 🔺
@sentry/sveltekit (client) 53.35 kB +1.72% +899 B 🔺
@sentry/core/server 41.8 kB +1.66% +680 B 🔺
@sentry/core/browser 13.81 kB - -
@sentry/node 153.72 kB +0.46% +701 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 84.04 kB - -
@sentry/node - without tracing 95.49 kB +0.72% +675 B 🔺
@sentry/node - without channel injection 131.79 kB +0.55% +715 B 🔺
@sentry/aws-serverless 103.78 kB +0.79% +805 B 🔺
@sentry/cloudflare (withSentry) - minified 212.4 kB +0.86% +1.8 kB 🔺
@sentry/cloudflare (withSentry) 526.06 kB +0.68% +3.53 kB 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 230.08 kB +0.79% +1.8 kB 🔺

View base workflow run

@logaretm
logaretm force-pushed the awad/tunnel-nitro branch 2 times, most recently from 9765090 to 9bad613 Compare October 15, 2026 17:15
@logaretm
logaretm force-pushed the awad/tunnel-nitro branch 2 times, most recently from c1733f2 to fdca10d Compare October 15, 2026 17:44
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e1a3c68. Configure here.

@logaretm
logaretm force-pushed the awad/tunnel-nitro branch 2 times, most recently from 3596b0a to ec58ad6 Compare October 16, 2026 04:23
…iddleware

On Nitro v3, Nuxt and `@sentry/nitro` put the tunnel check first in h3's
middleware list, since Nitro runs the app's `server/middleware` before anything a
module registers and has no public way to go first. On Nitro v2, Nuxt answers
from the `request` hook.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nuxt and Nitro managed tunnel

1 participant