Improper Handling of Case Sensitivityorg.mvnpm: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 Improper Handling of Case Sensitivity in the /_image endpoint used by the @astrojs/node adapter, where the check that a requested local image is inside the build output directory compares paths case-insensitively. An attacker can read image files from outside the output directory by requesting /_image with an href such as /../../DIST/client/secret.png, which resolves to a directory that differs from the output directory only by letter case. Only sites that use on-demand rendering with @astrojs/node on a case-sensitive filesystem, with a case-variant directory next to the output directory, are affected, and only files the image service accepts can be read.
How to fix Improper Handling of Case Sensitivity? A fix was pushed into the master branch but not yet published.
| |
Incomplete List of Disallowed Inputsorg.mvnpm: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.
How to fix Incomplete List of Disallowed Inputs? Upgrade org.mvnpm:astro to version 7.4.5 or higher.
| |
Cross-site Scripting (XSS)org.mvnpm: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 Cross-site Scripting (XSS) via the prerenderElementChildren function in jsx.ts and the streaming renderer in streaming.ts, where dynamic children of <script> and <style> elements (e.g. <script>{value}</script>) in MDX are not escaped before being written to the output. An attacker who can control the dynamic expression passed as a child of a <script> or <style> tag in MDX content can inject arbitrary HTML, breaking out of the element and executing attacker-controlled script in the victim's browser. The root cause is that all plain-string children of these elements were unconditionally marked as raw HTML strings, treating dynamic values the same as literal content injected by remark/rehype plugins.
How to fix Cross-site Scripting (XSS)? Upgrade org.mvnpm:astro to version 7.3.2 or higher.
| |
Cross-site Scripting (XSS)org.mvnpm: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 Cross-site Scripting (XSS) via the addAnimationProperty function in packages/astro/src/runtime/server/transition.ts, where transition animation values are serialized into CSS without sanitization. An attacker who can control animation property values can inject arbitrary CSS declarations by supplying characters such as ;, {, or }, breaking out of the intended CSS value context and injecting additional properties or rules.
How to fix Cross-site Scripting (XSS)? Upgrade org.mvnpm:astro to version 7.3.3 or higher.
| |