CVE-2025-55303: Astro Astro Allows Unauthorized Third-party Images Vulnerability
MODERATECVE-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
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).
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.
npm install astro@5.13.2
npm install @astrojs/node@9.1.1
npm install astro@4.16.19
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
CVE-2025-55303 Affected Astro Versions
3 component(s)| 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?
Which Astro versions are affected?
What version fixes CVE-2025-55303?
Is astro affected?
Is @astrojs/node affected?
What is the CVSS score of CVE-2025-55303?
What CWE is associated with CVE-2025-55303?
How can I check npm dependencies for CVE-2025-55303?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}