Vulnerabilities in pkg:npm/astro

PACKAGE
Advisory Identifier: GHSA-mh32-jxcr-mh9f
Advisory Summary

CVE-2026-126361 is a LOW cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Astro libraries in the npm ecosystem. The issue involves xss via attribute injection in dynamic tag names. Remediation is available by upgrading affected packages to version 7.4.5.

29 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/astro

29 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-mh32-jxcr-mh9f CVE-2026-126361 LOW Astro: XSS via attribute injection in dynamic tag names
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-26w7-cxv4-gfx2 - CRITICAL Astro: Remote code execution through AVIF image optimization
GHSA-376h-93r7-7g6f CVE-2026-84376 MODERATE Astro: Authorization bypass from missing path-segment boundary check when stripping the configured base
GHSA-f48w-9m4c-m7f5 CVE-2026-59729 MODERATE Astro: XSS via unescaped spread attribute names in renderHTMLElement (incomplete fix for CVE-2026-54298)
GHSA-7pw4-f3q4-r2p2 CVE-2026-59727 LOW Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands
GHSA-2pvr-wf23-7pc7 CVE-2026-54299 HIGH Astro: Host header SSRF in prerendered error page fetch
GHSA-8hv8-536x-4wqp CVE-2026-50146 HIGH Astro: Reflected XSS via unescaped slot name
GHSA-8mv7-9c27-98vc CVE-2026-73423 MODERATE Astro: composable `astro/hono` pipeline bypasses `security.checkOrigin` when `middleware()` is absent or misordered
GHSA-4g3v-8h47-v7g6 CVE-2026-73422 MODERATE Astro: Reflected XSS via unescaped View Transition animation properties
GHSA-vj59-8hwv-xxmv CVE-2026-59731 HIGH Astro: Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
GHSA-jrpj-wcv7-9fh9 CVE-2026-54298 MODERATE Astro: XSS via Unescaped Attribute Names in Spread Props
GHSA-xr5h-phrj-8vxv CVE-2026-45028 LOW Astro: Server island encrypted parameters vulnerable to cross-component replay
GHSA-j687-52p2-xcff CVE-2026-41067 MODERATE Astro: XSS in define:vars via incomplete </script> tag sanitization
GHSA-g735-7g2w-hh3f CVE-2026-33769 LOW Astro: Remote allowlist bypass via unanchored matchPathname wildcard
GHSA-whqg-ppgf-wp8c CVE-2025-66202 MODERATE Astro has an Authentication Bypass via Double URL Encoding, a bypass for CVE-2025-64765
GHSA-fvmw-cj7j-j39q CVE-2025-65019 MODERATE Astro Cloudflare adapter has Stored Cross-site Scripting vulnerability in /_image endpoint
GHSA-ggxq-hp9w-j794 CVE-2025-64765 MODERATE Astro's middleware authentication checks based on url.pathname can be bypassed via url encoded values
GHSA-w2vj-39qv-7vh7 CVE-2025-64745 LOW Astro development server error page is vulnerable to reflected Cross-site Scripting
GHSA-xf8x-j4p2-f749 CVE-2025-55303 MODERATE Astro allows unauthorized third-party images in _image endpoint
GHSA-cq8c-xv66-36gw CVE-2025-54793 MODERATE Astros's duplicate trailing slash feature leads to an open redirection security issue
GHSA-49w6-73cw-chjr CVE-2024-56159 HIGH Astro's server source code is exposed to the public if sourcemaps are enabled
GHSA-c4pw-33h3-35xw CVE-2024-56140 MODERATE Atro CSRF Middleware Bypass (security.checkOrigin)
GHSA-m85w-3h95-hcf9 CVE-2024-47885 MODERATE DOM Clobbering Gadget found in astro's client-side router that leads to XSS
GHSA-wrwg-2hg8-v723 CVE-2025-64764 HIGH Astro vulnerable to reflected XSS via the server islands feature
GHSA-x3h8-62x9-952g CVE-2025-64757 LOW Astro Development Server has Arbitrary Local File Read
GHSA-hr2q-hp5q-x767 CVE-2025-64525 MODERATE Astro vulnerable to URL manipulation via headers, leading to middleware and CVE-2025-61925 bypass
GHSA-qcpr-679q-rhm2 CVE-2025-59837 HIGH Astro's bypass of image proxy domain validation leads to SSRF and potential XSS
GHSA-5ff5-9fcw-vg88 CVE-2025-61925 MODERATE Astro's `X-Forwarded-Host` is reflected without validation

CVE-2026-126361 at a Glance

CVE Identifier CVE-2026-126361
GHSA Identifier GHSA-mh32-jxcr-mh9f
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Astro
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-126361

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.

astro fixed: 7.4.5
npm install astro@7.4.5
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 astro

How to Check if You Are Affected

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

npm ls astro

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.5), your application is affected.

Note: The npm ls astro 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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 When a dynamic tag (`const Tag = ...; <Tag />`) resolves to a string, Astro renders it as a raw HTML element name. The name was filtered to remove characters that could inject attributes, but the filter did not handle `/`. Because HTML parsers treat `/` inside a tag as an attribute separator, a tag name such as `img/src/onerror=alert(1)` was rendered as an `<img>` element with an `onerror` attribute. The JSX renderer used for MDX did not filter string tag names at all. For example: ```astro --- const Tag = Astro.url.searchParams.get('as') ?? 'div'; --- <Tag>hello</Tag> ``` rendered `?as=img/src/onerror=alert(1)` as live HTML. ## Impact Reflected or stored cross-site scripting, but only in applications that use untrusted input (such as a request parameter or an uncontrolled CMS field) as all or part of an element name. Astro itself never derives element names from request data. Applications that let content choose an element should map that input to a fixed set of known tags. Letting untrusted input choose an element name is unsafe even with a correct filter, because it can still select elements such as `script` or `iframe`. ## Affected versions `astro` <= 7.4.4. ## Patches Fixed in `astro` 7.4.5. String tag names in `.astro` dynamic tags, JSX, and MDX now render only the leading valid element name, so characters such as `/` or `=` can no longer change the generated markup. Strings that do not start with a valid element name now throw an error. ## Workarounds Upgrade to `astro` 7.4.5 or later. Before upgrading, do not use untrusted input as an element name, or map it to a fixed set of known tags. ## Credits Reported by @uttej-badwane.

CVE-2026-126361 Affected Astro Versions

1 component(s)
Fixed Versions:
7.4.5
Product / Package Ecosystem Affected Versions Fixed Version
astro
npm
< 7.4.5
7.4.5

References

Frequently Asked Questions

What is CVE-2026-126361?
CVE-2026-126361 is a security vulnerability in Astro involving XSS via attribute injection in dynamic tag names under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Astro versions are affected?
Affected versions include releases prior to 7.4.5 across affected packages: astro.
What version fixes CVE-2026-126361?
Upgrading to 7.4.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is astro affected?
Yes, astro is affected in releases prior to 7.4.5. Upgrade your dependency to 7.4.5 or later.
What CWE is associated with CVE-2026-126361?
CVE-2026-126361 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-126361?
Run the dependency tree command: 'npm ls astro'. 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-mh32-jxcr-mh9f",
  "modified" : "2026-11-13T18:39:55Z",
  "published" : "2026-11-13T18:39:54Z",
  "aliases" : [ "CVE-2026-126361" ],
  "summary" : "Astro: XSS via attribute injection in dynamic tag names",
  "details" : "## Summary\n\nWhen a dynamic tag (`const Tag = ...; <Tag />`) resolves to a string, Astro renders it as a raw HTML element name. The name was filtered to remove characters that could inject attributes, but the filter did not handle `/`. Because HTML parsers treat `/` inside a tag as an attribute separator, a tag name such as `img/src/onerror=alert(1)` was rendered as an `<img>` element with an `onerror` attribute. The JSX renderer used for MDX did not filter string tag names at all.\n\nFor example:\n\n```astro\n---\nconst Tag = Astro.url.searchParams.get('as') ?? 'div';\n---\n<Tag>hello</Tag>\n```\n\nrendered `?as=img/src/onerror=alert(1)` as live HTML.\n\n## Impact\n\nReflected or stored cross-site scripting, but only in applications that use untrusted input (such as a request parameter or an uncontrolled CMS field) as all or part of an element name. Astro itself never derives element names from request data.\n\nApplications that let content choose an element should map that input to a fixed set of known tags. Letting untrusted input choose an element name is unsafe even with a correct filter, because it can still select elements such as `script` or `iframe`.\n\n## Affected versions\n\n`astro` <= 7.4.4.\n\n## Patches\n\nFixed in `astro` 7.4.5. String tag names in `.astro` dynamic tags, JSX, and MDX now render only the leading valid element name, so characters such as `/` or `=` can no longer change the generated markup. Strings that do not start with a valid element name now throw an error.\n\n## Workarounds\n\nUpgrade to `astro` 7.4.5 or later. Before upgrading, do not use untrusted input as an element name, or map it to a fixed set of known tags.\n\n## Credits\n\nReported by @uttej-badwane.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "astro"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.4.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.4.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/security/advisories/GHSA-mh32-jxcr-mh9f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-126361"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/pull/18520"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/commit/e023abac912d7cb6af2b9fb5107ef5dabc667096"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/withastro/astro"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/releases/tag/astro@7.4.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-184", "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-13T18:39:54Z",
    "nvd_published_at" : "2026-11-13T00:20:11Z"
  }
}