CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-84376

CVE-2026-84376: Authorization Bypass via Missing Path-Segment Boundary Validation in Astro

Alon Barad
Alon Barad
Software Engineer

Sep 9, 2026·6 min read·2 visits

Executive Summary (TL;DR)

Astro prior to 7.2.4 allowed attackers to bypass path-based authorization middleware via a partial string matching flaw when stripping custom base paths (e.g., /appX/admin resolved to /app/admin but bypassed middleware looking for /app/admin).

An authorization bypass vulnerability exists in the Astro web framework prior to version 7.2.4. When configured with a non-root base path, Astro's routing engine stripped the base path from incoming request URLs using an insecure prefix-match check without verifying path-segment boundaries. This created a path parser differential between user-defined middleware and the internal router. An unauthenticated attacker could bypass route-based authorization checks to access administrative or privileged endpoints by altering the path prefix segment.

Vulnerability Overview

Astro is a modern web framework designed for building content-driven websites. To support hosting applications under subpaths, the framework allows developers to define a custom, non-root base path (such as '/app'). When configured, Astro is responsible for routing requests relative to this base while developer-defined middleware manages global application concerns, including route-level authentication and authorization.

A flaw exists in Astro's path-handling subsystem prior to version 7.2.4. When parsing incoming HTTP request pathnames, the routing mechanism incorrectly evaluates and strips the base path using a simple prefix match without verifying path-segment boundaries. This implementation defect introduces a critical parser differential between the framework's internal routing engine and standard authorization middleware.

The vulnerability is classified as CWE-187 (Partial String Comparison). It represents a significant class of routing-related security flaws where inconsistent interpretations of a resource path between different security boundaries permit unauthorized access to protected components without authentication.

Root Cause Analysis

The root cause lies in how Astro's routing modules (such as BaseApp.removeBase, FetchState.#computePathname, and match-request.ts) stripped the configured base prefix from incoming request paths. To determine if an incoming request path fell under the configured base, the engine used a basic string comparison. Specifically, it checked if the requested pathname started with the base string via the JavaScript .startsWith() function.

When a base of '/app' was configured, a request for '/appX/admin' (where 'X' represents an arbitrary trailing character) successfully matched the .startsWith('/app') condition. Upon evaluating this condition as true, the router stripped the base path. It achieved this by calculating the length of the base path plus one character (to account for the expected slash delimiter) and slicing the original string from that index forward.

Applying this calculation to the path '/appX/admin' resulted in a slice operations of pathname.slice(5). This operation sliced off the prefix '/appX' and resolved the remaining path internally to '/admin'. Consequently, Astro treated the incoming request as a legitimate attempt to access the internal '/admin' route, completely ignoring the boundary mismatch of the '/appX' segment.

Architectural Inconsistency

The security impact of this vulnerability manifests because of how request objects are processed by middleware versus how they are matched by the internal router. Security middleware generally acts as an interceptor. It evaluates the raw, unmodified URL of the request as exposed by context.url.pathname to determine whether the client is authorized to access the requested resource.

When an attacker sends a request to '/appX/admin', the middleware inspects context.url.pathname and detects '/appX/admin'. Because this pathname does not match the protected pattern of '/app/admin' or start with '/app/admin/', the middleware permits the request to pass. The middleware acts under the assumption that the path refers to an unprivileged route.

However, once the middleware passes execution to the core framework, the router processes the URL using the flawed prefix-stripping routine. The path '/appX/admin' is stripped down to '/admin', which matches the internal protected page component. The core routing engine then renders the protected page and returns it to the client, successfully bypassing the access control boundary. This interaction is illustrated in the following diagram:

Exploitation Methodology

Exploiting this vulnerability requires specific application conditions. First, the application must be configured with a non-root base path, such as /app. Second, the application must implement middleware that enforces access control on routes by performing prefix or equality checks against context.url.pathname. Finally, the application must host protected routes under that same base path.

To initiate the exploit, an attacker crafts an HTTP request where the base path is concatenated with an arbitrary suffix character, immediately followed by the target route segment. For example, if the application base is /app and the target is /app/admin, the attacker sends a request to /app-admin or /appX/admin over the network.

Because the string /appX/admin begins with the prefix /app, Astro's router strips the prefix and resolves the request to the administrative controller. The authorization middleware, examining the full pathname, fails to detect that the request is targeting a restricted route because it does not match the expected pattern. This allows unauthenticated users to perform privileged administrative actions.

Patch Analysis and Code Walkthrough

To resolve this vulnerability, Astro's engineering team consolidated the path parsing logic into a robust helper function called stripRequestBase inside packages/internal-helpers/src/path.ts. This helper function completely eliminates naive prefix checking by enforcing strict path-segment boundary validation.

export function stripRequestBase(pathname: string, base: string): string {
  // 1. Collapse duplicate leading slashes to prevent multi-slash bypasses
  pathname = collapseDuplicateLeadingSlashes(pathname);
  const baseWithoutTrailingSlash = removeTrailingForwardSlash(base);
 
  // 2. Perform exact match check
  if (pathname === baseWithoutTrailingSlash) {
    return '/';
  }
 
  // 3. Enforce path-segment boundary by appending a slash separator
  if (pathname.startsWith(baseWithoutTrailingSlash + '/')) {
    return pathname.slice(baseWithoutTrailingSlash.length);
  }
 
  // 4. Return unmodified path if segment boundary is not met
  return pathname;
}

By verifying that the base path is followed immediately by a slash character (baseWithoutTrailingSlash + '/'), the patched code ensures that arbitrary suffixes like /appX do not trigger the slicing logic. Under the new implementation, a request to /appX/admin will fail the boundary check. The framework will return the unmodified path /appX/admin, leading to a safe 404 Not Found response instead of exposing the protected endpoint.

Incident Impact and Remediation Guidance

The vulnerability poses a moderate-to-high risk depending on the sensitivity of the protected routes hosted within the Astro application. Because exploiting the vulnerability requires no special privileges or user interaction, an unauthenticated attacker can consistently bypass middleware checks to access confidential data or execute administrative functions if the underlying route handler does not perform secondary authentication.

The primary remediation strategy is upgrading the core Astro dependency to version 7.2.4 or higher. Developers can update their projects using standard package managers. Executing npm install astro@7.2.4 or the equivalent command for your package manager will apply the path parsing fixes across all internal dependencies.

If immediate patching is not possible, developers can implement a temporary mitigation directly in their application's middleware. The middleware must manually validate that any incoming request pathname that starts with the base path also respects the path-segment boundary. Any path matching the prefix but failing the slash boundary check should be rejected immediately with an HTTP 400 Bad Request or 404 Not Found response.

Fix Analysis (1)

Technical Appendix

CVSS Score
6.3/ 10
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
EPSS Probability
0.41%
Top 66% most exploited

Affected Systems

Astro web application deployments utilizing a custom, non-root base path and relying on pathname-based authorization middleware.

Affected Versions Detail

Product
Affected Versions
Fixed Version
astro
withastro
< 7.2.47.2.4
AttributeDetail
CWE IDCWE-187 (Partial String Comparison)
Attack VectorNetwork (AV:N)
CVSS Score6.3 (Medium)
EPSS Score0.00407 (Percentile: 33.98%)
ImpactAuthorization Bypass
Exploit StatusPoC available (Unit test validation)
KEV StatusNot Listed in CISA KEV

MITRE ATT&CK Mapping

T1548Abuse Elevation Control Mechanism
Privilege Escalation
T1556Modify Authentication Process
Defense Evasion
CWE-187
Partial String Comparison

The software performs a string comparison associated with a security decision, but it does not compare the entire string or enforce a boundary check, allowing a partial match to succeed.

References & Sources

  • [1]Astro Security Advisory GHSA-376h-93r7-7g6f
  • [2]Astro Fix Pull Request #17701
  • [3]Astro Patch Commit
  • [4]Astro v7.2.4 Release Changelog
  • [5]NVD Vulnerability Details

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-84361
7.7

CVE-2026-84361: Remote Code Execution in Composer Perforce VCS Driver

A critical remote code execution vulnerability exists in the Composer PHP dependency manager due to improper neutralization of command parameters passed to the Perforce CLI client. Unauthenticated attackers can exploit this flaw via crafted package metadata in custom repositories or lock files, triggering arbitrary OS command execution when a user or automated CI/CD pipeline runs Composer commands.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 3 hours ago•GHSA-26W7-CXV4-GFX2
9.8

GHSA-26W7-CXV4-GFX2: Remote Code Execution in Astro via Outdated Sharp Native Dependency

A critical remote code execution vulnerability in Astro's image optimization pipeline allows unauthenticated attackers to trigger memory corruption via malformed AVIF images, due to outdated native dependencies in the sharp package.

Alon Barad
Alon Barad
5 views•7 min read
•about 5 hours ago•CVE-2026-81525
8.6

CVE-2026-81525: Cross-Tenant Database Retargeting via Dot and Null Injection in MongoDB PHP Driver

A high-severity namespace injection vulnerability in both the MongoDB Client Library for PHP (mongodb/mongodb) and the native PHP C Extension (ext-mongodb) allows unauthenticated remote attackers to bypass logical database separation and execute database commands inside unauthorized storage compartments via dot (".") and null byte ("\0") injection.

Alon Barad
Alon Barad
6 views•7 min read
•about 6 hours ago•CVE-2026-84452
8.6

CVE-2026-84452: Localhost Remote Code Execution via CORS Misconfiguration in Windows ML CLI

A critical vulnerability (CVE-2026-84452) in the Windows ML CLI (winml-cli) HTTP server component allows unauthenticated remote code execution via permissive CORS and lack of request validation.

Alon Barad
Alon Barad
7 views•7 min read
•about 7 hours ago•CVE-2026-15603
5.3

CVE-2026-15603: Log Forging via Unescaped Unicode Line Separators in morgan Middleware

An incomplete fix vulnerability (CVE-2026-15603) in the morgan HTTP request logger middleware for Node.js allows unauthenticated remote attackers to forge log entries. The flaw arises because the escaping mechanism does not neutralize Unicode line separator characters, enabling attackers to inject payloads that trick downstream log processors into splitting single log records into multiple logical entries.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 9 hours ago•CVE-2026-82333
7.5

CVE-2026-82333: Remote Denial of Service via Sparse Array Manipulation in Multer

A high-severity denial of service vulnerability in the Node.js middleware 'multer' allows unauthenticated remote attackers to exhaust CPU resources and freeze applications. By submitting small, specially crafted 'multipart/form-data' requests containing large array indices alongside conflicting parameter keys, attackers force synchronous execution loops over up to 4.2 billion elements within the underlying 'append-field' library.

Amit Schendel
Amit Schendel
10 views•7 min read