Incomplete List of Disallowed Inputs Affecting astro package, versions <7.4.5


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.32% (25th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-ASTRO-22552448
  • published15 Nov 2026
  • disclosed13 Nov 2026
  • creditUttej Badwane

Introduced: 13 Nov 2026

NewCVE-2026-126361  (opens in a new tab)
CWE-184  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade astro to version 7.4.5 or higher.

Overview

astro is an Astro is a modern site builder with web best practices, performance, and DX front-of-mind.

Affected versions of this package are vulnerable to Incomplete List of Disallowed Inputs via insufficient sanitization of dynamic tag names in the sanitizeElementName helper and the JSX renderer. When a dynamic tag resolves to a string, Astro renders it as a raw HTML element name. The existing filter removed characters such as &, <, >, quotes, and whitespace, but did not handle /. Because HTML parsers treat / inside a tag as an attribute separator, a tag name such as img/src/onerror=alert(1) is rendered as an <img> element with an injected onerror attribute. The JSX renderer used for MDX did not apply any filter to string tag names at all, making it fully unguarded. An attacker who can control the value passed as a dynamic tag name - for example through a URL query parameter - can inject arbitrary HTML attributes and execute JavaScript in the victim's browser.

Note: This is only exploitable in applications that use untrusted input (such as a request parameter or an uncontrolled CMS field) as all or part of an element name, as Astro itself never derives element names from request data.

Workaround

Before upgrading, do not use untrusted input as an element name. If dynamic element selection is required, map the untrusted input to a fixed set of known, safe tag names.

CVSS Base Scores

version 4.0
version 3.1