CVE-2026-84376: Astro: Authorization bypass from missing path-segment boundary check when stripping the configured base
Summary Astro stripped a configured base path from request pathnames using a string-prefix check that did not verify a path-segment boundary. With base: "/app", a request to /appX/admin was treated as being under the base and resolved internally to the /admin route, while middleware still observed the public pathname /appX/admin.
Published Sep 8, 2026
Affected packages
astro
- Ecosystem
- npm
- Affected
- <= 7.2.3
- Fixed in
- 7.2.4
- Check
npm ls astro
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Astro stripped a configured base path from request pathnames using a string-prefix check that did not verify a path-segment boundary. With base: "/app", a request to /appX/admin was treated as being under the base and resolved internally to the /admin route, while middleware still observed the public pathname /appX/admin. Middleware that authorizes routes by inspecting context.url.pathname could therefore be bypassed.
Impact
An unauthenticated remote attacker can bypass pathname-based middleware authorization in applications that:
- Configure a non-root
base. - Protect base-prefixed routes in middleware using
context.url.pathname.
Because routing and middleware resolved different effective pathnames, a request such as /appX/admin (or other single-character extensions like /app2/admin or /app-/admin) reached the protected /admin route without passing the middleware check that guards /app/admin. Astro's authentication guide demonstrates protecting routes in middleware via context.url.pathname, so this is a reasonable and expected pattern.
Affected versions
astro <= 7.2.3.
Patches
Fixed in astro 7.2.4. Base stripping now requires the pathname to equal the base without its trailing slash, or to be followed by a /, so a prefix that does not end on a path-segment boundary is no longer treated as being under the base. Routing and context.url.pathname now resolve the same pathname.
Workarounds
Upgrade to astro 7.2.4 or later. As a mitigation before upgrading, avoid relying solely on prefix checks of context.url.pathname for authorization, or reject requests whose pathname does not begin with the configured base followed by a path-segment boundary.
Credits
Reported by @Ryoga-exe.
Credited to Ryoga-exe.
References
- https://github.com/withastro/astro/security/advisories/GHSA-376h-93r7-7g6f
- https://nvd.nist.gov/vuln/detail/CVE-2026-84376
- https://github.com/withastro/astro/pull/17701
- https://github.com/withastro/astro/commit/05763a0884aabb1da78a2749d5bb9d41ae620527
- https://github.com/withastro/astro/releases/tag/[email protected]
- https://github.com/advisories/GHSA-376h-93r7-7g6f
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-126361
Astro: XSS via attribute injection in dynamic tag names
low2.3Nov 13, 2026CVE-2026-126364
Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems
medium6.3No fixNov 13, 2026CVE-2026-114127
Astro: Arbitrary CSS injection in Astro View Transitions
low2.3Oct 22, 2026CVE-2026-114128
Astro: Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX rendering
medium6.5Oct 22, 2026GHSA-26w7-cxv4-gfx2
Astro: Remote code execution through AVIF image optimization
critical9.8Sep 8, 2026CVE-2026-59727
Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands
low2.1Jul 20, 2026
