GHSA-whqg-ppgf-wp8c CVE-2025-66202
Astro has an Authentication Bypass via Double URL Encoding, a bypass for CVE-2025-64765
- Severity
- 6.5 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 0.31%
- Chance of exploitation in the next 30 days. Higher than 24.32% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-647 Use of Non-Canonical URL Paths for Authorization Decisions
- Fix
5.15.8- Upgrade astro to this version or later
Description
Authentication Bypass via Double URL Encoding in Astro
Bypass for CVE-2025-64765 / GHSA-ggxq-hp9w-j794
Summary
A double URL encoding bypass allows any unauthenticated attacker to bypass path-based authentication checks in Astro middleware, granting unauthorized access to protected routes. While the original CVE-2025-64765 (single URL encoding) was fixed in v5.15.8, the fix is insufficient as it only decodes once. By using double-encoded URLs like /%2561dmin instead of /%61dmin, attackers can still bypass authentication and access protected resources such as /admin, /api/internal, or any route protected by middleware pathname checks.
Fix
A more secure fix is just decoding once, then if the request has a %xx format, return a 400 error by using something like :
if (containsEncodedCharacters(pathname)) {
// Multi-level encoding detected - reject request
return new Response(
'Bad Request: Multi-level URL encoding is not allowed',
{
status: 400,
headers: { 'Content-Type': 'text/plain' }
}
);
}
Affected versions
npm
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
astro npm → 5.15.8
- npm
npm install astro@5.15.8- yarn
yarn add astro@5.15.8- pnpm
pnpm add astro@5.15.8
Severity breakdown
CVSS 3.1 6.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Weakness
CWE-647: Use of Non-Canonical URL Paths for Authorization Decisions
The product defines policy namespaces and makes authorization decisions based on the assumption that a URL is canonical. This can allow a non-canonical URL to bypass the authorization.
How to prevent it
- Architecture and Design: Make access control policy based on path information in canonical form. Use very restrictive regular expressions to validate that the path is in the expected form.
- Architecture and Design: Reject all alternate path encodings that are not in the expected canonical form.
References
Advisories
Fixes and patches
Packages
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-98hj-9722-w3j8 Astro: Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX rendering | Medium | Also affects astro |
| GHSA-mpr7-6m5w-76rw Astro: Arbitrary CSS injection in Astro View Transitions | Low | Also affects astro |
| GHSA-26w7-cxv4-gfx2 Astro: Remote code execution through AVIF image optimization | Critical | Also affects astro |
| GHSA-376h-93r7-7g6f Astro: Authorization bypass from missing path-segment boundary check when stripping the configured base | Medium | Also affects astro |
| GHSA-8mv7-9c27-98vc Astro: composable `astro/hono` pipeline bypasses `security.checkOrigin` when `middleware()` is absent or misordered | Medium | Also affects astro |
| GHSA-f48w-9m4c-m7f5 Astro: XSS via unescaped spread attribute names in renderHTMLElement (incomplete fix for CVE-2026-54298) | Medium | Also affects astro |
| GHSA-7pw4-f3q4-r2p2 Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands | Low | Also affects astro |
| GHSA-4g3v-8h47-v7g6 Astro: Reflected XSS via unescaped View Transition animation properties | Medium | Also affects astro |
Credits: zomaxsec
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor