CVE-2025-64764: Astro Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-wrwg-2hg8-v723
CVSS 7.1
CWE-80 CWE-79
Published
Advisory Summary

CVE-2025-64764 is a HIGH (CVSS 7.1) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Astro libraries in the npm ecosystem. The issue involves astro vulnerable to reflected xss via the server islands feature. Remediation is available by upgrading affected packages to version 5.15.8.

CVE-2025-64764 at a Glance

CVE Identifier CVE-2025-64764
GHSA Identifier GHSA-wrwg-2hg8-v723
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
Affected Product Astro
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.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:U/C:L/I:H/A:N).

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

How to Fix CVE-2025-64764

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.15.8
npm install astro@5.15.8
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-64764, 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.15.8), 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-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. 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 After some research it appears that it is possible to obtain a reflected XSS when the server islands feature is used in the targeted application, **regardless of what was intended by the component template(s)**. ## Details Server islands run in their own isolated context outside of the page request and use the following pattern path to hydrate the page: `/_server-islands/[name]`. These paths can be called via GET or POST and use three parameters: - `e`: component to export - `p`: the transmitted properties, encrypted - `s`: for the slots Slots are placeholders for external HTML content, and therefore allow, by default, the injection of code if the component template supports it, nothing exceptional in principle, just a feature. This is where it becomes problematic: it is possible, independently of the component template used, even if it is completely empty, to inject a slot containing an XSS payload, whose parent is a tag whose name is is the absolute path of the island file. Enabling reflected XSS on any application, regardless of the component templates used, provided that the server islands is used at least once. **How ?** By default, when a call is made to the endpoint `/_server-islands/[name]`, the value of the parameter `e` is `default`, pointing to a function exported by the component's module. Upon further investigation, we find that two other values ​​are possible for the component export (param `e`) in a typical configuration: `url` and `file`. `file` returns a string value corresponding to the absolute path of the island file. Since the value is of type `string`, it fulfills the following condition and leads to [this code block](https://github.com/withastro/astro/blob/190106149908ef6826899459146ef9f0ead602ab/packages/astro/src/runtime/server/render/component.ts#L279): <img width="804" height="571" alt="image" src="https://github.com/user-attachments/assets/25ea6c16-fc27-477a-a1ad-e5edf0819b31" /> An entire template is created, completely independently, and then returned: - the absolute path name is sanitized and then injected as the tag name - `childSlots`, the value provided to the `s` parameter, is injected as a child All of this is done using `markHTMLString`. This allows the injection of any XSS payload, **even if the component template intended by the application is initially empty or does not provide for the use of slots.** ## Proof of concept For our Proof of Concept (PoC), we will use a minimal repository: - Latest Astro version at the time (5.15.6) - Use of Island servers, with a completely empty component, to demonstrate what we explained previously [Download the PoC repository](https://github.com/zhero-web-sec/astro-app-2) Access the following URL and note the opening of the popup, demonstrating the reflected XSS: http://localhost:4321/_server-islands/ServerTime?e=file&p=&s={%22zhero%22:%22%3Cimg%20src=x%20onerror=alert(0)%3E%22} <img width="1781" height="529" alt="image" src="https://github.com/user-attachments/assets/92f8134a-d1c7-4d3f-818e-214842c239c8" /> The value of the parameter `s` must be in JSON format and the payload must be injected at the value level, not the key level : <img width="3273" height="1840" alt="for_respected_patron" src="https://github.com/user-attachments/assets/8ac0079a-3dee-49e8-b639-322f77c84b83" /> Despite the initial template being empty, it is created because the value of the URL parameter `e` is set to `file`, as explained earlier. The parent tag is the name of the component's internal route, and its child is the value of the key "zhero" (*the name doesn't matter*) of the URL parameter `s`. ## Credits - Allam Rachid ([zhero;](https://zhero-web-sec.github.io/research-and-things/)) - Allam Yasser (inzo)

CVE-2025-64764 Affected Astro Versions

1 component(s)
Fixed Versions:
5.15.8
Product / Package Ecosystem Affected Versions Fixed Version
astro
npm
< 5.15.8
5.15.8

References

Frequently Asked Questions

What is CVE-2025-64764?
CVE-2025-64764 is a security vulnerability in Astro involving Astro vulnerable to reflected XSS via the server islands feature under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS).
Which Astro versions are affected?
Affected versions include releases prior to 5.15.8 across affected packages: astro.
What version fixes CVE-2025-64764?
Upgrading to 5.15.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is astro affected?
Yes, astro is affected in releases prior to 5.15.8. Upgrade your dependency to 5.15.8 or later.
What is the CVSS score of CVE-2025-64764?
CVE-2025-64764 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2025-64764?
CVE-2025-64764 is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.).
How can I check npm dependencies for CVE-2025-64764?
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-wrwg-2hg8-v723",
  "modified" : "2025-11-19T20:00:14Z",
  "published" : "2025-11-19T20:00:14Z",
  "aliases" : [ "CVE-2025-64764" ],
  "summary" : "Astro vulnerable to reflected XSS via the server islands feature",
  "details" : "## Summary\nAfter some research it appears that it is possible to obtain a reflected XSS when the server islands feature is used in the targeted application, **regardless of what was intended by the component template(s)**.\n\n## Details\nServer islands run in their own isolated context outside of the page request and use the following pattern path to hydrate the page: `/_server-islands/[name]`. These paths can be called via GET or POST and use three parameters:\n\n- `e`: component to export\n- `p`: the transmitted properties, encrypted\n- `s`: for the slots\n\nSlots are placeholders for external HTML content, and therefore allow, by default, the injection of code if the component template supports it, nothing exceptional in principle, just a feature.\n\nThis is where it becomes problematic: it is possible, independently of the component template used, even if it is completely empty, to inject a slot containing an XSS payload, whose parent is a tag whose name is is the absolute path of the island file. Enabling reflected XSS on any application, regardless of the component templates used, provided that the server islands is used at least once.\n\n**How ?**\n\nBy default, when a call is made to the endpoint `/_server-islands/[name]`, the value of the parameter `e` is `default`, pointing to a function exported by the component's module.\n\nUpon further investigation, we find that two other values ​​are possible for the component export (param `e`) in a typical configuration: `url` and `file`. `file` returns a string value corresponding to the absolute path of the island file. Since the value is of type `string`, it fulfills the following condition and leads to [this code block](https://github.com/withastro/astro/blob/190106149908ef6826899459146ef9f0ead602ab/packages/astro/src/runtime/server/render/component.ts#L279):\n\n<img width=\"804\" height=\"571\" alt=\"image\" src=\"https://github.com/user-attachments/assets/25ea6c16-fc27-477a-a1ad-e5edf0819b31\" />\n\nAn entire template is created, completely independently, and then returned:\n\n- the absolute path name is sanitized and then injected as the tag name\n- `childSlots`, the value provided to the `s` parameter, is injected as a child\n\nAll of this is done using `markHTMLString`. This allows the injection of any XSS payload, **even if the component template intended by the application is initially empty or does not provide for the use of slots.**\n\n## Proof of concept\nFor our Proof of Concept (PoC), we will use a minimal repository:\n- Latest Astro version at the time (5.15.6)\n- Use of Island servers, with a completely empty component, to demonstrate what we explained previously\n\n[Download the PoC repository](https://github.com/zhero-web-sec/astro-app-2)\n\nAccess the following URL and note the opening of the popup, demonstrating the reflected XSS:\n\nhttp://localhost:4321/_server-islands/ServerTime?e=file&p=&s={%22zhero%22:%22%3Cimg%20src=x%20onerror=alert(0)%3E%22}\n\n<img width=\"1781\" height=\"529\" alt=\"image\" src=\"https://github.com/user-attachments/assets/92f8134a-d1c7-4d3f-818e-214842c239c8\" />\n\nThe value of the parameter `s` must be in JSON format and the payload must be injected at the value level, not the key level : \n\n<img width=\"3273\" height=\"1840\" alt=\"for_respected_patron\" src=\"https://github.com/user-attachments/assets/8ac0079a-3dee-49e8-b639-322f77c84b83\" />\n\nDespite the initial template being empty, it is created because the value of the URL parameter `e` is set to `file`, as explained earlier. The parent tag is the name of the component's internal route, and its child is the value of the key \"zhero\" (*the name doesn't matter*) of the URL parameter `s`.\n\n## Credits\n- Allam Rachid ([zhero;](https://zhero-web-sec.github.io/research-and-things/))\n- Allam Yasser (inzo)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "astro"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.15.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.15.6"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/security/advisories/GHSA-wrwg-2hg8-v723"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-64764"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/commit/790d9425f39bbbb462f1c27615781cd965009f91"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/withastro/astro"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-80" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-11-19T20:00:14Z",
    "nvd_published_at" : "2025-11-19T17:15:52Z"
  }
}