CVE-2026-84376: Astro Authorization Bypass From Missing Path-segment Vulnerability

MODERATE
Advisory Identifier: GHSA-376h-93r7-7g6f
CWE-187
Published
Advisory Summary

CVE-2026-84376 is a MODERATE authorization bypass from missing path-segment vulnerability (CWE-187: Partial String Comparison) affecting Astro libraries in the npm ecosystem. The issue involves authorization bypass from missing path-segment boundary check when stripping the configured base. Remediation is available by upgrading affected packages to version 7.2.4.

CVE-2026-84376 at a Glance

CVE Identifier CVE-2026-84376
GHSA Identifier GHSA-376h-93r7-7g6f
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-187: Partial String Comparison
Affected Product Astro
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-84376

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.

astro fixed: 7.2.4
npm install astro@7.2.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls astro

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-84376, inspect your project dependencies using npm:

npm ls astro

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 7.2.4), your application is affected.

Note: The npm ls astro 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-187: Partial String Comparison, where the product performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses. 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

## 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.

CVE-2026-84376 Affected Astro Versions

1 component(s)
Fixed Versions:
7.2.4
Product / Package Ecosystem Affected Versions Fixed Version
astro
npm
< 7.2.4
7.2.4

References

Frequently Asked Questions

What is CVE-2026-84376?
CVE-2026-84376 is a security vulnerability in Astro involving Authorization bypass from missing path-segment boundary check when stripping the configured base under CWE-187: Partial String Comparison.
Which Astro versions are affected?
Affected versions include releases prior to 7.2.4 across affected packages: astro.
What version fixes CVE-2026-84376?
Upgrading to 7.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is astro affected?
Yes, astro is affected in releases prior to 7.2.4. Upgrade your dependency to 7.2.4 or later.
What CWE is associated with CVE-2026-84376?
CVE-2026-84376 is classified under CWE-187: Partial String Comparison (The product performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses.).
How can I check npm dependencies for CVE-2026-84376?
Run the dependency tree command: 'npm ls astro'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-376h-93r7-7g6f",
  "modified" : "2026-09-08T21:26:02Z",
  "published" : "2026-09-08T21:26:02Z",
  "aliases" : [ "CVE-2026-84376" ],
  "summary" : "Astro: Authorization bypass from missing path-segment boundary check when stripping the configured base",
  "details" : "## 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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "astro"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.2.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.2.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/security/advisories/GHSA-376h-93r7-7g6f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-84376"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/pull/17701"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/commit/05763a0884aabb1da78a2749d5bb9d41ae620527"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/withastro/astro"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/releases/tag/astro@7.2.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-187" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-08T21:26:02Z",
    "nvd_published_at" : "2026-09-02T17:18:00Z"
  }
}