LOW · CVSS 4.0 EPSS 0.5% · 39th percentile CWE-184CWE-79

CVE-2026-126361: Astro: XSS via attribute injection in dynamic tag names

Published 2026-11-13 · Updated 2026-11-13 · Also known as GHSA-mh32-jxcr-mh9f

Summary

Astro contains an XSS vulnerability via attribute injection in dynamic tag names when strings contain characters like slashes. Engineering teams using Astro versions up to 7.4.4 that process untrusted input for dynamic tags should upgrade immediately.

Who is affected

Reflected or stored cross-site scripting can occur in applications that utilize untrusted input, such as request parameters or uncontrolled CMS fields, as all or part of a dynamic element name. Astro itself does not derive element names from request data by default, requiring applications to actively pass untrusted input into dynamic tag names for the vulnerability to be triggered.

Exploitability

The vulnerability requires network access and user interaction with low attack complexity, though it relies on phishing or tricking a user with a crafted input payload since attack requirements involve partial conditions. The EPSS score is 0.003 and it is not present in the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
npm astro >= 0, < 7.4.5 7.4.5 npm install [email protected]

Tracked tools affected

Astro · Astro security advisories · Fixed in Astro 7.4.5 release notes

CVSS 4.0 vector

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

Attack vectorNetwork
Attack complexityLow
Attack requirementsPresent
Privileges requiredNone
User interactionPassive
Confidentiality (vulnerable system)Low
Integrity (vulnerable system)Low
Availability (vulnerable system)None
Confidentiality (subsequent systems)Low
Integrity (subsequent systems)Low
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

What causes the XSS vulnerability in Astro?

When a dynamic tag resolves to a string, the filtering logic failed to handle slashes correctly. Because HTML parsers treat slashes inside a tag name as attribute separators, malicious input could inject arbitrary HTML attributes like onerror.

Which versions of Astro are affected?

All astro versions up to and including 7.4.4 are affected.

How was the issue resolved?

The issue is fixed in astro version 7.4.5, where string tag names render only the leading valid element name and strings not starting with a valid element name throw an error.

Original advisory description
## 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.

References

Source records: GHSA-mh32-jxcr-mh9f (OSV.dev) · EPSS by FIRST, 2026-11-26.