CVE-2026-59731: withastro Astro authorization bypass via URL decoding mismatch

CVE-2026-59731 · Severity: high · CVSS 8.2 · Published 2026-07-08

Astro is a popular web framework used to build fast websites. A security flaw in how it handles web addresses (URLs) allows attackers to bypass security rules that protect sensitive areas like admin dashboards or private APIs. By specially crafting a URL with many layers of encoding, an attacker can trick the security system into thinking the request is safe while the internal router still sends them to a protected page.

Technologies: astro (npm). Vendors: npm.

Quick answers

Is CVE-2026-59731 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-59731 being exploited in the wild.
How severe is CVE-2026-59731?
High severity, with a CVSS score of 8.2, published 8 July 2026.
Which products and versions are affected?
astro (npm) >= 6.4.7, < 6.4.8, SEMVER:introduced=6.4.7,fixed=6.4.8.
Is there a fix for CVE-2026-59731?
Yes. astro (npm): upgrade to 6.4.8 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-59731 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-59731?
Check whether you run astro (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • astro (npm): upgrade to 6.4.8 or later
    npm install astro@6.4.8

Technical details

Astro 6.4.7 introduced iterative URI decoding with a maximum cap of 10 iterations. If a URL is encoded more than 10 times (e.g., depth 11), the middleware receives a partially decoded string, while the subsequent route matching logic performs an additional decodeURI() call. This canonicalization mismatch (CWE-647) allows an attacker to bypass path-based authorization checks in middleware and reach protected routes. The vulnerability is exploitable when applications use path-based authorization and rewrite-based routing (next(context.url)). The issue is resolved in version 6.4.8 by rejecting requests that exceed the decoding iteration limit.

Affected products

  • withastro Astro >= 6.4.7, < 6.4.8

Identifiers

  • CVE-2026-59731
  • GHSA-vj59-8hwv-xxmv

Timeline

  • 2026-07-01: disclosed
  • 2026-07-01: patched: Fixed in version 6.4.8
  • 2026-07-20: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.