{"id":"GHSA-98hj-9722-w3j8","summary":"Astro: Reflected/Stored XSS via unescaped \u003cscript\u003e/\u003cstyle\u003e tag content in JSX/MDX rendering","details":"## Summary\n\nAstro's JSX and MDX rendering pipeline treated string children of `\u003cscript\u003e` and `\u003cstyle\u003e` elements as trusted HTML. When a dynamic value was passed through a JSX expression, such as `\u003cscript\u003e{value}\u003c/script\u003e`, an attacker-controlled value containing `\u003c/script\u003e` or `\u003c/style\u003e` could terminate the element and inject arbitrary HTML and JavaScript.\n\nOther JSX expression contexts escaped dynamic strings automatically. This behavior was limited to `\u003cscript\u003e` and `\u003cstyle\u003e` children rendered through Astro's `astro:jsx` renderer, including MDX components.\n\n## Details\n\nThe affected rendering paths marked all string children of `\u003cscript\u003e` and `\u003cstyle\u003e` elements as safe HTML, without distinguishing literal content generated by the compiler from dynamic expression values. An application was vulnerable when attacker-controlled data, such as a query parameter or CMS field, was interpolated directly into one of these elements.\n\nFor example, a value containing `\u003c/script\u003e\u003cscript\u003ealert(1)\u003c/script\u003e` passed to `\u003cscript\u003e{value}\u003c/script\u003e` was emitted without escaping. The browser interpreted the first closing tag as markup and executed the injected script.\n\nThe fix preserves raw rendering for literal script and style content while escaping dynamic string children like other JSX expression values.\n\n## Impact\n\nAffected applications could be vulnerable to reflected or stored cross-site scripting. Exploitation required an application to pass attacker-controlled data directly as a dynamic child of a `\u003cscript\u003e` or `\u003cstyle\u003e` element in MDX or through the `astro:jsx` runtime. Successful exploitation allowed arbitrary JavaScript execution in the victim's browser under the application's origin.\n\n## Patches\n\nThis issue is patched in `astro@7.3.2`.\n\n## Workarounds\n\nDo not interpolate untrusted dynamic values directly into `\u003cscript\u003e` or `\u003cstyle\u003e` element children. Applications that cannot upgrade should validate and contextually encode these values before rendering them.\n\n## Credit\n\nReported by [@RKasai127](https://github.com/RKasai127).","aliases":["CVE-2026-114128"],"modified":"2026-10-22T16:45:03.728568551Z","published":"2026-10-22T16:30:26Z","database_specific":{"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-10-22T16:30:26Z","nvd_published_at":"2026-10-21T18:17:25Z","cwe_ids":["CWE-79"]},"references":[{"type":"WEB","url":"https://github.com/withastro/astro/security/advisories/GHSA-98hj-9722-w3j8"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-114128"},{"type":"WEB","url":"https://github.com/withastro/astro/pull/17896"},{"type":"WEB","url":"https://github.com/withastro/astro/commit/a548223607b9bb146d5d90ddda495343f9a2a739"},{"type":"PACKAGE","url":"https://github.com/withastro/astro"},{"type":"WEB","url":"https://github.com/withastro/astro/releases/tag/astro@7.3.2"}],"affected":[{"package":{"name":"astro","ecosystem":"npm","purl":"pkg:npm/astro"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"7.3.2"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-98hj-9722-w3j8/GHSA-98hj-9722-w3j8.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"}]}