CVE-2026-126364: Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems
Summary The /image endpoint used by the @astrojs/node adapter checks that a requested local image is inside the build output directory before reading it from disk. That check compared paths case-insensitively. On case-sensitive filesystems (such as Linux), a directory whose path differs from the output directory only by letter case is a different directory, but it passed the check.
Published Nov 13, 2026
Affected packages
@astrojs/node
- Ecosystem
- npm
- Affected
- <= 11.1.11
- Fixed in
- No patched version yet
- Check
npm ls @astrojs/node
astro
- Ecosystem
- npm
- Affected
- >= 5.14.3, <= 7.4.6
- Fixed in
- 7.4.7
- Check
npm ls astro
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The /_image endpoint used by the @astrojs/node adapter checks that a requested local image is inside the build output directory before reading it from disk. That check compared paths case-insensitively. On case-sensitive filesystems (such as Linux), a directory whose path differs from the output directory only by letter case is a different directory, but it passed the check.
For example, with the client output directory at /srv/app/dist/client/, a request such as:
/_image?href=/../../DIST/client/secret.png&w=32&f=pngresolved to /srv/app/DIST/client/secret.png and was served, even though that file is outside the output directory.
Impact
An unauthenticated attacker can read image files from outside the output directory, but only when all of the following are true:
- The site uses on-demand rendering with the
@astrojs/nodeadapter. - The server runs on a case-sensitive filesystem.
- A directory exists whose path matches the output directory except for letter case (for example
DIST/clientnext todist/client). Such a layout is unusual, and the attacker cannot create it.
Only files the image service accepts can be read. Raster images are returned after resizing; SVG files are returned unchanged. Other file types fail during processing. Plain path traversal outside the output directory (for example /../../secret.png) was already rejected and is not affected.
Affected versions
astro >= 5.14.3, <= 7.4.6, when used with @astrojs/node (all versions up to 11.1.11). The vulnerable image endpoint is provided by astro and used by the @astrojs/node adapter.
Patches
Fixed in astro 7.4.7. The path check now compares paths exactly, and only ignores letter case for Windows drive-letter paths. The fix ships in astro, so upgrading @astrojs/node alone is not enough.
Workarounds
Upgrade to astro 7.4.7 or later. Before upgrading, make sure no directory next to the build output directory has a path that differs from it only by letter case.
Credits
Reported by @zachariah-mithani.
Credited to zachariah-mithani.
References
- https://github.com/withastro/astro/security/advisories/GHSA-r3h5-4585-7x3w
- https://nvd.nist.gov/vuln/detail/CVE-2026-126364
- https://github.com/withastro/astro/commit/7da442bb286e0c29e1c9e1add6727b7cbf434f1a
- https://github.com/withastro/astro/releases/tag/[email protected]
- https://github.com/advisories/GHSA-r3h5-4585-7x3w
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-126361
Astro: XSS via attribute injection in dynamic tag names
low2.3Nov 13, 2026CVE-2026-114127
Astro: Arbitrary CSS injection in Astro View Transitions
low2.3Oct 22, 2026CVE-2026-114128
Astro: Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX rendering
medium6.5Oct 22, 2026CVE-2026-102984
Astro: Malformed port in the Host header can crash the Node adapter
high8.2Sep 30, 2026CVE-2026-84376
Astro: Authorization bypass from missing path-segment boundary check when stripping the configured base
medium6.3Sep 8, 2026GHSA-26w7-cxv4-gfx2
Astro: Remote code execution through AVIF image optimization
critical9.8Sep 8, 2026
