CVE-2025-55303

CVE-2025-55303 is a medium-severity cross-site scripting (XSS) vulnerability in @astrojs/node (npm), affecting versions <= 9.1.0. It is fixed in 9.1.1, 4.16.19, 5.13.2.

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 or image.remotePatterns 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 ([email protected]).

  2. Configure it to use the Node adapter (@astrojs/[email protected], newer versions are not impacted):

    // 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.

Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.

CVE-2025-55303 has a CVSS score of 6.1 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (9.1.1, 4.16.19, 5.13.2); upgrading removes the vulnerable code path.

Affected versions

@astrojs/node (<= 9.1.0) astro (<= 4.16.18) astro (>= 5.0.0-alpha.0, < 5.13.2)

Security releases

@astrojs/node → 9.1.1 (npm) astro → 4.16.19 (npm) astro → 5.13.2 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade the following packages to resolve this vulnerability:

@astrojs/node to 9.1.1 or later; astro to 4.16.19 or later; astro to 5.13.2 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2025-55303? CVE-2025-55303 is a medium-severity cross-site scripting (XSS) vulnerability in @astrojs/node (npm), affecting versions <= 9.1.0. It is fixed in 9.1.1, 4.16.19, 5.13.2. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. How severe is CVE-2025-55303? CVE-2025-55303 has a CVSS score of 6.1 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2025-55303?
    • @astrojs/node (npm) (versions <= 9.1.0)
    • astro (npm) (versions <= 4.16.18)
  4. Is there a fix for CVE-2025-55303? Yes. CVE-2025-55303 is fixed in 9.1.1, 4.16.19, 5.13.2. Upgrade to this version or later.
  5. Is CVE-2025-55303 exploitable, and should I be worried? Whether CVE-2025-55303 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2025-55303 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2025-55303?
    • Upgrade @astrojs/node to 9.1.1 or later
    • Upgrade astro to 4.16.19 or later
    • Upgrade astro to 5.13.2 or later

Other vulnerabilities in @astrojs/node

CVE-2026-29772CVE-2026-27729CVE-2026-27829CVE-2026-25545CVE-2025-55303

Stop the waste.
Protect your environment with Kodem.