CVE-2025-55303: Astro Astro Allows Unauthorized Third-party Images Vulnerability

MODERATE
Advisory Identifier: GHSA-xf8x-j4p2-f749
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2025-55303 is a MODERATE (CVSS 6.1) astro allows unauthorized third-party images vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Astro libraries in the npm ecosystem. The issue involves astro allows unauthorized third-party images in _image endpoint. Remediation is available by upgrading affected packages to version 5.13.2, 9.1.1, 4.16.19.

CVE-2025-55303 at a Glance

CVE Identifier CVE-2025-55303
GHSA Identifier GHSA-xf8x-j4p2-f749
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Astro
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-55303

To remediate this vulnerability, upgrade all affected Astro dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

astro fixed: 5.13.2
npm install astro@5.13.2
@astrojs/node fixed: 9.1.1
npm install @astrojs/node@9.1.1
astro fixed: 4.16.19
npm install astro@4.16.19
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls astro

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-55303, inspect your project dependencies using npm:

npm ls astro

Analyze the terminal output to locate any version of Astro in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.13.2), your application is affected.

Note: The npm ls astro command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Astro, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary In affected versions of `astro`, the image optimization endpoint in projects deployed with on-demand rendering allows images from unauthorized third-party domains to be served. ### Details On-demand rendered sites built with Astro include an `/_image` endpoint which returns optimized versions of images. The `/_image` endpoint is restricted to processing local images bundled with the site and also supports remote images from domains the site developer has manually authorized (using the [`image.domains`](https://docs.astro.build/en/reference/configuration-reference/#imagedomains) or [`image.remotePatterns`](https://docs.astro.build/en/reference/configuration-reference/#imageremotepatterns) options). However, a bug in impacted versions of `astro` allows an attacker to bypass the third-party domain restrictions by using a protocol-relative URL as the image source, e.g. `/_image?href=//example.com/image.png`. ### Proof of Concept 1. Create a new minimal Astro project (`astro@5.13.0`). 2. Configure it to use the Node adapter (`@astrojs/node@9.1.0` — newer versions are not impacted): ```js // astro.config.mjs import { defineConfig } from 'astro/config'; import node from '@astrojs/node'; export default defineConfig({ adapter: node({ mode: 'standalone' }), }); ``` 3. Build the site by running `astro build`. 4. Run the server, e.g. with `astro preview`. 5. Append `/_image?href=//placehold.co/600x400` to the preview URL, e.g. <http://localhost:4321/_image?href=//placehold.co/600x400> 6. The site will serve the image from the unauthorized `placehold.co` origin. ### Impact Allows a non-authorized third-party to create URLs on an impacted site’s origin that serve unauthorized image content. In the case of SVG images, this could include the risk of cross-site scripting (XSS) if a user followed a link to a maliciously crafted SVG.

CVE-2025-55303 Affected Astro Versions

3 component(s)
Fixed Versions:
5.13.29.1.14.16.19
Product / Package Ecosystem Affected Versions Fixed Version
astro
npm
≥ 5.0.0-alpha.0
< 5.13.2
5.13.2
@astrojs/node
npm
< 9.1.1
9.1.1
astro
npm
< 4.16.19
4.16.19

References

Frequently Asked Questions

What is CVE-2025-55303?
CVE-2025-55303 is a security vulnerability in Astro involving Astro allows unauthorized third-party images in _image endpoint under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Astro versions are affected?
Affected versions include releases prior to 5.13.2, 9.1.1, 4.16.19 across affected packages: astro, @astrojs/node.
What version fixes CVE-2025-55303?
Upgrading to 5.13.2, 9.1.1, 4.16.19 (or the latest patched release for your respective branch) resolves the vulnerability.
Is astro affected?
Yes, astro is affected in releases prior to 5.13.2, 4.16.19. Upgrade your dependency to 5.13.2, 4.16.19 or later.
Is @astrojs/node affected?
Yes, @astrojs/node is affected in releases prior to 9.1.1. Upgrade your dependency to 9.1.1 or later.
What is the CVSS score of CVE-2025-55303?
CVE-2025-55303 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2025-55303?
CVE-2025-55303 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2025-55303?
Run the dependency tree command: 'npm ls astro'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xf8x-j4p2-f749",
  "modified" : "2025-11-27T08:07:30Z",
  "published" : "2025-08-19T15:40:31Z",
  "aliases" : [ "CVE-2025-55303" ],
  "summary" : "Astro allows unauthorized third-party images in _image endpoint",
  "details" : "### Summary\n\nIn affected versions of `astro`, the image optimization endpoint in projects deployed with on-demand rendering allows images from unauthorized third-party domains to be served.\n\n### Details\n\nOn-demand rendered sites built with Astro include an `/_image` endpoint which returns optimized versions of images.\n\nThe `/_image` endpoint is restricted to processing local images bundled with the site and also supports remote images from domains the site developer has manually authorized (using the [`image.domains`](https://docs.astro.build/en/reference/configuration-reference/#imagedomains) or [`image.remotePatterns`](https://docs.astro.build/en/reference/configuration-reference/#imageremotepatterns) options).\n\nHowever, a bug in impacted versions of `astro` allows an attacker to bypass the third-party domain restrictions by using a protocol-relative URL as the image source, e.g. `/_image?href=//example.com/image.png`.\n\n### Proof of Concept\n\n1. Create a new minimal Astro project (`astro@5.13.0`).\n\n2. Configure it to use the Node adapter (`@astrojs/node@9.1.0` — newer versions are not impacted):\n\n   ```js\n   // astro.config.mjs\n   import { defineConfig } from 'astro/config';\n   import node from '@astrojs/node';\n\n   export default defineConfig({\n   \tadapter: node({ mode: 'standalone' }),\n   });\n   ```\n\n3. Build the site by running `astro build`.\n\n4. Run the server, e.g. with `astro preview`.\n\n5. Append `/_image?href=//placehold.co/600x400` to the preview URL, e.g. <http://localhost:4321/_image?href=//placehold.co/600x400>\n\n6. The site will serve the image from the unauthorized `placehold.co` origin.\n\n### Impact\n\nAllows a non-authorized third-party to create URLs on an impacted site’s origin that serve unauthorized image content.\nIn the case of SVG images, this could include the risk of cross-site scripting (XSS) if a user followed a link to a maliciously crafted SVG.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "astro"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0-alpha.0"
      }, {
        "fixed" : "5.13.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@astrojs/node"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.1.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 9.1.0"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "astro"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.16.19"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.16.18"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/security/advisories/GHSA-xf8x-j4p2-f749"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-55303"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/commit/4d16de7f95db5d1ec1ce88610d2a95e606e83820"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/withastro/astro"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-19T15:40:31Z",
    "nvd_published_at" : "2025-08-19T19:15:36Z"
  }
}