Vulnerabilities in pkg:npm/@astrojs/node

PACKAGE
Advisory Identifier: GHSA-r3h5-4585-7x3w
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.

10 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@astrojs/node

10 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@astrojs/node. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-r3h5-4585-7x3w CVE-2026-126364 MODERATE Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems
GHSA-qh8j-hqjv-7m4x CVE-2026-102984 HIGH Astro: Malformed port in the Host header can crash the Node adapter
GHSA-r557-wffq-wvrc CVE-2026-59730 LOW @astrojs/node: Backslash-prefixed paths not recognized as internal by trailing-slash redirect
GHSA-c57f-mm3j-27q9 CVE-2026-41322 MODERATE Astro: Cache Poisoning due to incorrect error handling when if-match header is malformed
GHSA-qq67-mvv5-fw3g CVE-2026-25545 MODERATE Astro has Full-Read SSRF in error rendering via Host: header injection
GHSA-3rmj-9m5h-8fpv CVE-2026-29772 MODERATE Astro: Memory exhaustion DoS due to missing request body size limit in Server Islands
GHSA-cj9f-h6r6-4cx2 CVE-2026-27829 MODERATE Astro is vulnerable to SSRF due to missing allowlist enforcement in remote image inferSize
GHSA-jm64-8m5q-4qh8 CVE-2026-27729 MODERATE Astro has memory exhaustion DoS due to missing request body size limit in Server Actions
GHSA-xf8x-j4p2-f749 CVE-2025-55303 MODERATE Astro allows unauthorized third-party images in _image endpoint
GHSA-9x9c-ghc5-jhw9 CVE-2025-55207 MODERATE @astrojs/node's trailing slash handling causes open redirect issue

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"
  }
}