astro

Ecosystem: npm

Downloads:

Vulnerabilities from the last (months)
  • 1CriticalAffects 1 version
  • 6HighAffects 7 versions
  • 0MediumAffects 0 versions
  • 17ModerateAffects 18 versions
  • 7LowAffects 7 versions
Severity distribution (all time)
31vulnerabilities
  • Critical1 (3.2%)
  • High6 (19.4%)
  • Medium0 (0.0%)
  • Moderate17 (54.8%)
  • Low7 (22.6%)

Monthly breakdown

  • Critical
  • High
  • Medium
  • Moderate
  • Low
  • 2 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 1
  • 2 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 1
  • 2 vulnerabilities
    • Critical: 1
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 5 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 3
    • Low: 1
  • 3 vulnerabilities
    • Critical: 0
    • High: 2
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 0
    • Low: 1
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 0
    • Low: 1
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 6 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 3
    • Low: 2
  • 2 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 2 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 2
    • Low: 0
  • 2 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 0

Vulnerabilities (31)

Known vulnerabilities affecting astro, based on data from OSV.

Vulnerabilities affecting astro
IDSeveritySummaryAffected versionsPublishedSource
GHSA-mh32-jxcr-mh9fLowAstro: XSS via attribute injection in dynamic tag names## 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> ``` rende
  • < 7.4.5
GitHub (opens in a new tab)
GHSA-r3h5-4585-7x3wModerateAstro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems## Summary The `/_image` endpoint used by the `@astrojs/node` adapter checks that a requested local image is inside the build output directory before reading it from disk. That check compared paths case-insensitively. On case-sensitive filesystems (such as Linux), a directory whose path differs from the output directory only by letter case is a different directory, but it passed the check. For example, with the client output directory at `/srv/app/dist/client/`, a request such as: ```text /_image?href=/../../DIST/client/secret.png&w=32&f=png ``` resolved to `/srv/app/DIST/client/secret.png
  • >= 5.14.3, < 7.4.7
GitHub (opens in a new tab)
GHSA-98hj-9722-w3j8ModerateAstro: Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX rendering## Summary Astro's JSX and MDX rendering pipeline treated string children of `<script>` and `<style>` elements as trusted HTML. When a dynamic value was passed through a JSX expression, such as `<script>{value}</script>`, an attacker-controlled value containing `</script>` or `</style>` could terminate the element and inject arbitrary HTML and JavaScript. Other JSX expression contexts escaped dynamic strings automatically. This behavior was limited to `<script>` and `<style>` children rendered through Astro's `astro:jsx` renderer, including MDX components. ## Details The affected rendering
  • < 7.3.2
GitHub (opens in a new tab)
GHSA-mpr7-6m5w-76rwLowAstro: Arbitrary CSS injection in Astro View Transitions### Summary Astro's server-side View Transition CSS generator did not keep string animation properties within their generated CSS declarations. In an application that passes attacker-controlled data into an animation property such as `duration`, a value containing CSS delimiters could terminate the declaration and rule, then add attacker-selected CSS to the server-rendered page. The injected content remains inside the generated `<style>` element. It cannot terminate that element or inject HTML or JavaScript because Astro escapes `<` before emitting the stylesheet. ### Severity Exploitation
  • >= 7.1.0, < 7.3.3
GitHub (opens in a new tab)
GHSA-26w7-cxv4-gfx2CriticalAstro: Remote code execution through AVIF image optimizationA vulnerability in `libheif`, used by the default Sharp image service in Astro, can lead to remote code execution when a malicious AVIF image is optimized. Projects are affected when an attacker can cause Astro to process an untrusted AVIF image. The fix was released in Astro 7.2.8, which requires Sharp 0.35.4.
  • < 7.2.8
GitHub (opens in a new tab)
GHSA-376h-93r7-7g6fModerateAstro: Authorization bypass from missing path-segment boundary check when stripping the configured base## Summary Astro stripped a configured `base` path from request pathnames using a string-prefix check that did not verify a path-segment boundary. With `base: "/app"`, a request to `/appX/admin` was treated as being under the base and resolved internally to the `/admin` route, while middleware still observed the public pathname `/appX/admin`. Middleware that authorizes routes by inspecting `context.url.pathname` could therefore be bypassed. ## Impact An unauthenticated remote attacker can bypass pathname-based middleware authorization in applications that: - Configure a non-root `base`. -
  • < 7.2.4
GitHub (opens in a new tab)
GHSA-4g3v-8h47-v7g6ModerateAstro: Reflected XSS via unescaped View Transition animation properties## Summary Astro's server-side View Transition CSS generator interpolates animation properties into an inline `<style>` element without escaping them for the CSS and HTML contexts. An attacker-controlled value passed to an animation property such as `duration` can contain a `</style>` sequence, terminate the generated style element, and inject arbitrary HTML or JavaScript. This is similar to GHSA-8hv8-536x-4wqp, but exploits a different injection point: unescaped View Transition animation values in a server-generated `<style>` element rather than an unescaped slot name in a hydration templa
  • >= 2.9.0, < 7.1.0
GitHub (opens in a new tab)
GHSA-7pw4-f3q4-r2p2LowAstro: Cross-site scripting via unescaped transition:* directive values on hydrated islands### Summary When a `transition:persist`, `transition:scope`, or `transition:persist-props` directive is applied to a client-hydrated (`client:*`) component, Astro copied the directive value onto the rendered `<astro-island>` element **without HTML-escaping it**. If a developer reflects attacker-controlled input into one of these directives, an attacker can break out of the attribute and inject arbitrary HTML/JavaScript into the server-rendered output, resulting in reflected cross-site scripting (XSS). ### Severity Although a generic reflected XSS scores in the Medium range, exploitation her
  • >= 3.10.0, < 7.0.4
GitHub (opens in a new tab)
GHSA-8mv7-9c27-98vcModerateAstro: composable `astro/hono` pipeline bypasses `security.checkOrigin` when `middleware()` is absent or misordered## Summary In the composable `astro/hono` pipeline, the `security.checkOrigin` protection is only installed by the `middleware()` primitive. The `actions()` and `pages()` primitives each dispatch to user code independently, so a pipeline that mounts either primitive before (or without) `middleware()` will bypass the origin check for those requests. ## Details `security.checkOrigin` (default: `true`) is intended to reject cross-site `POST`/`PUT`/`PATCH`/`DELETE` form submissions. In the classic pipeline (`astro()` all-in-one), the check always runs because Astro injects a virtual middleware
  • >= 7.0.0, < 7.0.6
GitHub (opens in a new tab)
GHSA-f48w-9m4c-m7f5ModerateAstro: XSS via unescaped spread attribute names in renderHTMLElement (incomplete fix for CVE-2026-54298)## Summary The fix for CVE-2026-54298 (GHSA-jrpj-wcv7-9fh9) added an `INVALID_ATTR_NAME_CHAR` guard to `addAttribute()` so that spread-prop attribute names containing `"' >/=` or whitespace are dropped. A second attribute-rendering path, `renderHTMLElement()` in `packages/astro/src/runtime/server/render/dom.ts`, has its own inline attribute loop that does not go through `addAttribute()` and was not updated. It interpolates the attribute name unescaped and only escapes the value, so untrusted prop keys spread onto a native-`HTMLElement`-subclass component can still break out of the attribute c
  • < 7.0.6
GitHub (opens in a new tab)
  • GHSA-mh32-jxcr-mh9fLow
    Astro: XSS via attribute injection in dynamic tag names
    • < 7.4.5

    ## 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> ``` rende

    CVE: CVE-2026-126361

  • GHSA-r3h5-4585-7x3wModerate
    Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems
    • >= 5.14.3, < 7.4.7

    ## Summary The `/_image` endpoint used by the `@astrojs/node` adapter checks that a requested local image is inside the build output directory before reading it from disk. That check compared paths case-insensitively. On case-sensitive filesystems (such as Linux), a directory whose path differs from the output directory only by letter case is a different directory, but it passed the check. For example, with the client output directory at `/srv/app/dist/client/`, a request such as: ```text /_image?href=/../../DIST/client/secret.png&w=32&f=png ``` resolved to `/srv/app/DIST/client/secret.png

    CVE: CVE-2026-126364

  • GHSA-98hj-9722-w3j8Moderate
    Astro: Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX rendering
    • < 7.3.2

    ## Summary Astro's JSX and MDX rendering pipeline treated string children of `<script>` and `<style>` elements as trusted HTML. When a dynamic value was passed through a JSX expression, such as `<script>{value}</script>`, an attacker-controlled value containing `</script>` or `</style>` could terminate the element and inject arbitrary HTML and JavaScript. Other JSX expression contexts escaped dynamic strings automatically. This behavior was limited to `<script>` and `<style>` children rendered through Astro's `astro:jsx` renderer, including MDX components. ## Details The affected rendering

    CVE: CVE-2026-114128

  • GHSA-mpr7-6m5w-76rwLow
    Astro: Arbitrary CSS injection in Astro View Transitions
    • >= 7.1.0, < 7.3.3

    ### Summary Astro's server-side View Transition CSS generator did not keep string animation properties within their generated CSS declarations. In an application that passes attacker-controlled data into an animation property such as `duration`, a value containing CSS delimiters could terminate the declaration and rule, then add attacker-selected CSS to the server-rendered page. The injected content remains inside the generated `<style>` element. It cannot terminate that element or inject HTML or JavaScript because Astro escapes `<` before emitting the stylesheet. ### Severity Exploitation

    CVE: CVE-2026-114127

  • GHSA-26w7-cxv4-gfx2Critical
    Astro: Remote code execution through AVIF image optimization
    • < 7.2.8

    A vulnerability in `libheif`, used by the default Sharp image service in Astro, can lead to remote code execution when a malicious AVIF image is optimized. Projects are affected when an attacker can cause Astro to process an untrusted AVIF image. The fix was released in Astro 7.2.8, which requires Sharp 0.35.4.

  • GHSA-376h-93r7-7g6fModerate
    Astro: Authorization bypass from missing path-segment boundary check when stripping the configured base
    • < 7.2.4

    ## Summary Astro stripped a configured `base` path from request pathnames using a string-prefix check that did not verify a path-segment boundary. With `base: "/app"`, a request to `/appX/admin` was treated as being under the base and resolved internally to the `/admin` route, while middleware still observed the public pathname `/appX/admin`. Middleware that authorizes routes by inspecting `context.url.pathname` could therefore be bypassed. ## Impact An unauthenticated remote attacker can bypass pathname-based middleware authorization in applications that: - Configure a non-root `base`. -

    CVE: CVE-2026-84376

  • GHSA-4g3v-8h47-v7g6Moderate
    Astro: Reflected XSS via unescaped View Transition animation properties
    • >= 2.9.0, < 7.1.0

    ## Summary Astro's server-side View Transition CSS generator interpolates animation properties into an inline `<style>` element without escaping them for the CSS and HTML contexts. An attacker-controlled value passed to an animation property such as `duration` can contain a `</style>` sequence, terminate the generated style element, and inject arbitrary HTML or JavaScript. This is similar to GHSA-8hv8-536x-4wqp, but exploits a different injection point: unescaped View Transition animation values in a server-generated `<style>` element rather than an unescaped slot name in a hydration templa

    CVE: CVE-2026-73422

  • GHSA-7pw4-f3q4-r2p2Low
    Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands
    • >= 3.10.0, < 7.0.4

    ### Summary When a `transition:persist`, `transition:scope`, or `transition:persist-props` directive is applied to a client-hydrated (`client:*`) component, Astro copied the directive value onto the rendered `<astro-island>` element **without HTML-escaping it**. If a developer reflects attacker-controlled input into one of these directives, an attacker can break out of the attribute and inject arbitrary HTML/JavaScript into the server-rendered output, resulting in reflected cross-site scripting (XSS). ### Severity Although a generic reflected XSS scores in the Medium range, exploitation her

    CVE: CVE-2026-59727

  • GHSA-8mv7-9c27-98vcModerate
    Astro: composable `astro/hono` pipeline bypasses `security.checkOrigin` when `middleware()` is absent or misordered
    • >= 7.0.0, < 7.0.6

    ## Summary In the composable `astro/hono` pipeline, the `security.checkOrigin` protection is only installed by the `middleware()` primitive. The `actions()` and `pages()` primitives each dispatch to user code independently, so a pipeline that mounts either primitive before (or without) `middleware()` will bypass the origin check for those requests. ## Details `security.checkOrigin` (default: `true`) is intended to reject cross-site `POST`/`PUT`/`PATCH`/`DELETE` form submissions. In the classic pipeline (`astro()` all-in-one), the check always runs because Astro injects a virtual middleware

    CVE: CVE-2026-73423

  • GHSA-f48w-9m4c-m7f5Moderate
    Astro: XSS via unescaped spread attribute names in renderHTMLElement (incomplete fix for CVE-2026-54298)
    • < 7.0.6

    ## Summary The fix for CVE-2026-54298 (GHSA-jrpj-wcv7-9fh9) added an `INVALID_ATTR_NAME_CHAR` guard to `addAttribute()` so that spread-prop attribute names containing `"' >/=` or whitespace are dropped. A second attribute-rendering path, `renderHTMLElement()` in `packages/astro/src/runtime/server/render/dom.ts`, has its own inline attribute loop that does not go through `addAttribute()` and was not updated. It interpolates the attribute name unescaped and only escapes the value, so untrusted prop keys spread onto a native-`HTMLElement`-subclass component can still break out of the attribute c

    CVE: CVE-2026-59729

Showing 1-10 of 31 vulnerabilities