CVE-2026-126364: Astro Image Endpoint Vulnerability

MODERATE
Advisory Identifier: GHSA-r3h5-4585-7x3w
CWE-22 CWE-178
Published
Advisory Summary

CVE-2026-126364 is a MODERATE image endpoint vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Astro libraries in the npm ecosystem. The issue involves image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems. Remediation is available by upgrading affected packages to version 7.4.7.

CVE-2026-126364 at a Glance

CVE Identifier CVE-2026-126364
GHSA Identifier GHSA-r3h5-4585-7x3w
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Astro
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-126364

To remediate this vulnerability, upgrade all affected Astro dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@astrojs/node fixed: Latest secure release
npm install @astrojs/node@Latest secure release
astro fixed: 7.4.7
npm install astro@7.4.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @astrojs/node

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-126364, inspect your project dependencies using npm:

npm ls @astrojs/node

Analyze the terminal output to locate any version of Astro in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.4.7), your application is affected.

Note: The npm ls @astrojs/node command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Astro, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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: ```text /_image?href=/../../DIST/client/secret.png&w=32&f=png ``` resolved 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/node` adapter. - The server runs on a case-sensitive filesystem. - A directory exists whose path matches the output directory except for letter case (for example `DIST/client` next to `dist/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.

CVE-2026-126364 Affected Astro Versions

2 component(s)
Fixed Versions:
7.4.7
Product / Package Ecosystem Affected Versions Fixed Version
@astrojs/node
npm
≤ 11.1.11
astro
npm
≥ 5.14.3
< 7.4.7
7.4.7

References

Frequently Asked Questions

What is CVE-2026-126364?
CVE-2026-126364 is a security vulnerability in Astro involving Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Astro versions are affected?
Affected versions include releases prior to 7.4.7 across affected packages: @astrojs/node, astro.
What version fixes CVE-2026-126364?
Upgrading to 7.4.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @astrojs/node affected?
Yes, @astrojs/node is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is astro affected?
Yes, astro is affected in releases prior to 7.4.7. Upgrade your dependency to 7.4.7 or later.
What CWE is associated with CVE-2026-126364?
CVE-2026-126364 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2026-126364?
Run the dependency tree command: 'npm ls @astrojs/node'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r3h5-4585-7x3w",
  "modified" : "2026-11-13T18:35:59Z",
  "published" : "2026-11-13T18:35:59Z",
  "aliases" : [ "CVE-2026-126364" ],
  "summary" : "Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems",
  "details" : "## Summary\n\nThe `/_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.\n\nFor example, with the client output directory at `/srv/app/dist/client/`, a request such as:\n\n```text\n/_image?href=/../../DIST/client/secret.png&w=32&f=png\n```\n\nresolved to `/srv/app/DIST/client/secret.png` and was served, even though that file is outside the output directory.\n\n## Impact\n\nAn unauthenticated attacker can read image files from outside the output directory, but only when all of the following are true:\n\n- The site uses on-demand rendering with the `@astrojs/node` adapter.\n- The server runs on a case-sensitive filesystem.\n- A directory exists whose path matches the output directory except for letter case (for example `DIST/client` next to `dist/client`). Such a layout is unusual, and the attacker cannot create it.\n\nOnly 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.\n\n## Affected versions\n\n`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.\n\n## Patches\n\nFixed 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.\n\n## Workarounds\n\nUpgrade 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.\n\n## Credits\n\nReported by @zachariah-mithani.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@astrojs/node"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "11.1.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "astro"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.14.3"
      }, {
        "fixed" : "7.4.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.4.6"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/security/advisories/GHSA-r3h5-4585-7x3w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-126364"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/commit/7da442bb286e0c29e1c9e1add6727b7cbf434f1a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/withastro/astro"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/releases/tag/astro@7.4.7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-178", "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-13T18:35:59Z",
    "nvd_published_at" : "2026-11-13T00:20:12Z"
  }
}