{"id":"CVE-2026-84376","aliases":["CVE-2026-84376","GHSA-376h-93r7-7g6f"],"related":[],"kind":"vulnerability","state":"published","title":"Astro: Authorization bypass from missing path-segment boundary check when stripping the configured base","summary":"Astro is a web framework for content-driven websites. Prior to 7.2.4, Astro stripped a configured non-root base path from request pathnames using a string-prefix check without verifying a path-segment boundary. With base \"/app\", a request to \"/appX/admin\" resolved internally to the protected \"/admin\" route while middleware observed \"/appX/admin\" in context.url.pathname. In applications that authorize base-prefixed routes by inspecting context.url.pathname, an unauthenticated remote attacker could bypass pathname-based middleware authorization and reach protected routes. This issue is fixed in version 7.2.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Astro is a web framework for content-driven websites. Prior to 7.2.4, Astro stripped a configured non-root base path from request pathnames using a string-prefix check without verifying a path-segment boundary. With base \"/app\", a request to \"/appX/admin\" resolved internally to the protected \"/admin\" route while middleware observed \"/appX/admin\" in context.url.pathname. In applications that authorize base-prefixed routes by inspecting context.url.pathname, an unauthenticated remote attacker could bypass pathname-based middleware authorization and reach protected routes. This issue is fixed in version 7.2.4.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nAstro 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.\n\n## Impact\n\nAn unauthenticated remote attacker can bypass pathname-based middleware authorization in applications that:\n\n- Configure a non-root `base`.\n- Protect base-prefixed routes in middleware using `context.url.pathname`.\n\nBecause 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.\n\n## Affected versions\n\n`astro` <= 7.2.3.\n\n## Patches\n\nFixed 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.\n\n## Workarounds\n\nUpgrade 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.\n\n## Credits\n\nReported by @Ryoga-exe.","format":"markdown","source":"ghsa"}],"published":"2026-09-02T16:24:23.799Z","modified":"2026-09-09T21:04:42.813Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-187"],"affected":[{"ranges":[{"version":"< 7.2.4","status":"affected"}],"vendor":"withastro","product":"astro","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"7.2.4"}],"ecosystem":"npm","package":"astro","purl":"pkg:npm/astro","source":"ghsa"}],"references":[{"url":"https://github.com/withastro/astro/security/advisories/GHSA-376h-93r7-7g6f","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/withastro/astro/pull/17701","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/withastro/astro/commit/05763a0884aabb1da78a2749d5bb9d41ae620527","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/withastro/astro/releases/tag/astro@7.2.4","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84376","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/withastro/astro","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-09-04T02:44:13.248Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-84376","url":"https://www.cve.org/CVERecord?id=CVE-2026-84376","licence":"CVE Terms of Use","modified":"2026-09-04T02:44:22.828Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-376h-93r7-7g6f","url":"https://github.com/advisories/GHSA-376h-93r7-7g6f","licence":"CC-BY-4.0","modified":"2026-09-08T21:30:04.767Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-84376","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84376","licence":"Public domain","modified":"2026-09-09T21:04:42.813Z"}],"updatedAt":"2026-11-25T22:59:36.131Z","epss":{"score":0.00707,"percentile":0.49103,"date":"2026-11-30T12:00:22.000Z"}}