CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-4W7W-66W2-5VF9

GHSA-4W7W-66W2-5VF9: Path Traversal in Vite transformMiddleware Source Map Handling

Alon Barad
Alon Barad
Software Engineer

Apr 6, 2026·7 min read·133 visits

Executive Summary (TL;DR)

Vite dev server lacks boundary checks on source map requests, enabling arbitrary file reads of JSON-formatted .map files via directory traversal.

A path traversal vulnerability exists in the Vite development server's transform middleware, allowing attackers to read restricted files ending in '.map' that contain valid JSON data.

Vulnerability Overview

The Vite development server provides an environment for modern web application development, offering features like Hot Module Replacement (HMR) and optimized dependency pre-bundling. During the pre-bundling phase, Vite processes and caches dependencies within the node_modules/.vite/deps directory to improve server start times and page load performance. The server uses various middleware components to handle requests for these optimized assets, including source map files that assist in debugging.

A vulnerability identified as GHSA-4W7W-66W2-5VF9 exists in the source map handling mechanism of Vite's transformation middleware. The specific flaw is a path traversal vulnerability (CWE-22) that occurs when the server processes requests for files ending with the .map extension. The middleware calculates the physical file path on the host filesystem based on the incoming request URL but fails to enforce strict directory boundaries.

This insufficient validation allows a remote or unprivileged local attacker to construct crafted HTTP requests containing directory traversal sequences. By appending ../ sequences to the optimized dependencies base path, the attacker can navigate outside the intended .vite/deps directory. The vulnerability exposes the host filesystem to unauthorized file read operations, subject to specific parsing constraints enforced by the server.

Root Cause Analysis

The root cause of this path traversal vulnerability resides in transformMiddleware, implemented within packages/vite/src/node/server/middlewares/transform.ts. This middleware is responsible for transforming requested modules and serving associated source map files. When the middleware detects a request for a file with a .map extension, it enters a dedicated code block designed to locate and return the source map content.

To determine the target file location, the middleware computes the sourcemapPath variable. Depending on the request URL structure, it either uses fsPathFromId(url) for paths starting with a predefined filesystem prefix or constructs the path by resolving the URL suffix against the server root using path.resolve(). The resulting absolute path represents the intended location of the source map file on the host operating system.

The critical failure occurs immediately after this path resolution step. The implementation assumes that the request URL, and subsequently the resolved sourcemapPath, will inherently point to a location within the authorized optimized dependencies directory. It lacks an explicit boundary check or jail validation mechanism to verify that the final physical path does not escape the node_modules/.vite/deps hierarchy. Consequently, the middleware blindly passes the resolved traversal path to the filesystem read operation.

Code Analysis

Prior to the patch, the transformMiddleware handled the path resolution process without verifying the structural integrity of the final directory path. The vulnerable implementation directly utilized the resolved sourcemapPath in an asynchronous filesystem read operation. If the file existed and the read succeeded, the server proceeded to parse the file contents as JSON.

const sourcemapPath = url.startsWith(FS_PREFIX)
  ? fsPathFromId(url)
  : normalizePath(path.resolve(server.config.root, url.slice(1)))
 
try {
  const map = JSON.parse(
    await fsp.readFile(sourcemapPath, 'utf-8'),
  )
  // Execution continues to serve the map content
}

The patch introduced in commit 79f002f2286c03c88c7b74c511c7f9fc6dc46694 addresses the vulnerability by adding a mandatory validation step before the filesystem read operation. The developers leveraged the existing depsOptimizer utility to ensure the resolved path strictly corresponds to a known optimized dependency file. If the isOptimizedDepFile check fails, the middleware immediately yields control to the next handler, preventing unauthorized access.

const sourcemapPath = url.startsWith(FS_PREFIX)
  ? fsPathFromId(url)
  : normalizePath(path.resolve(server.config.root, url.slice(1)))
 
// url may contain relative path that may resolve outside of the optimized deps directory
if (!depsOptimizer.isOptimizedDepFile(sourcemapPath)) {
  return next()
}
 
try {
  const map = JSON.parse(
    await fsp.readFile(sourcemapPath, 'utf-8'),
  )

Exploitation

Exploiting this path traversal vulnerability requires the attacker to send a specifically formatted HTTP GET request to the Vite development server. The request must target the @fs endpoint or the standard optimized dependencies path, injecting directory traversal characters (../) to construct a relative path to the target file. The Vite routing mechanism passes this URL to the transformMiddleware for processing.

The exploitation is constrained by two critical requirements enforced by the middleware logic. First, the requested file path must terminate with the .map extension, as the vulnerable code path is only triggered for source map requests. Second, the target file must contain strictly valid JSON data. The middleware executes JSON.parse() on the file contents immediately after reading; if the parsing fails, an exception is thrown, and the file contents are not returned to the attacker.

A practical proof-of-concept attack involves targeting known configuration files or existing source maps on the host operating system that satisfy these constraints. For example, a request to http://localhost:5173/@fs/C:/path/to/project/node_modules/.vite/deps/../../../../Windows/System32/some_config.json.map will successfully return the contents of some_config.json.map assuming the file exists and contains valid JSON. This demonstrates the capability to traverse outside the project root and access arbitrary locations on the storage volume.

Impact Assessment

The security impact of GHSA-4W7W-66W2-5VF9 is evaluated as moderate due to the strict preconditions required for successful data exfiltration. While the vulnerability grants arbitrary file read capabilities across the host filesystem, the requirement that the target file must end in .map and contain valid JSON significantly limits the scope of accessible data. The attacker cannot read standard configuration files like /etc/passwd or .env, as these lack the .map extension and do not conform to JSON formatting.

Despite these constraints, the vulnerability poses a risk to intellectual property and specific environment configurations. Attackers can target legitimate source map files residing in unrelated project directories on the same host. These source maps often contain embedded, unminified source code in the sourcesContent array, potentially exposing proprietary algorithms, internal API endpoints, or hardcoded credentials left in the source code of other applications.

The overall risk is heavily dependent on the network exposure of the Vite development server. By default, Vite binds to the local loopback interface (localhost), restricting exploitation to local attackers or scenarios involving cross-site request forgery (CSRF) in complex environments. However, if the developer explicitly configures the server to listen on all interfaces (using the --host flag), the attack surface expands to the local area network or the public internet, substantially increasing the likelihood of remote exploitation.

Remediation

The primary remediation for GHSA-4W7W-66W2-5VF9 is to update the Vite package to a patched release. The Vite maintenance team has issued patches across multiple major version lines. Developers must upgrade their project dependencies to Vite version 6.4.2, 7.3.2, or 8.0.5, depending on the major version currently in use. This update introduces the necessary path validation logic via the depsOptimizer.isOptimizedDepFile() function, neutralizing the traversal vector.

In environments where immediate patching is not feasible, security engineers should implement network-level mitigations to restrict access to the development server. Ensure that the Vite process is not launched with the --host 0.0.0.0 argument unless strictly required for specific testing scenarios. Restricting the service binding to 127.0.0.1 prevents remote attackers from communicating with the vulnerable middleware, effectively mitigating external exploitation attempts.

Additionally, development teams should review their filesystem architecture to ensure sensitive JSON configurations do not utilize the .map extension. While this is an uncommon pattern, eliminating potential target files reduces the residual risk in complex development environments. Implementing endpoint detection and response (EDR) rules or web application firewall (WAF) policies to flag consecutive ../ sequences in requests targeting port 5173 can provide an interim defensive layer.

Fix Analysis (1)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Affected Systems

Vite development server (vite npm package)

Affected Versions Detail

Product
Affected Versions
Fixed Version
vite
Vite
< 6.4.26.4.2
vite
Vite
>= 7.0.0, < 7.3.27.3.2
vite
Vite
>= 8.0.0, < 8.0.58.0.5
AttributeDetail
CWE IDCWE-22
Attack VectorNetwork / Local
ImpactArbitrary File Read (Constrained)
Exploit StatusProof of Concept Available
ComponenttransformMiddleware
Patch StatusPatched

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1190Exploit Public-Facing Application
Initial Access
T1020Automated Exfiltration
Exfiltration
CWE-22
Path Traversal

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

References & Sources

  • [1]GitHub Advisory: GHSA-4W7W-66W2-5VF9
  • [2]Fix Pull Request #22161
  • [3]Fix Commit
  • [4]Vite Changelog

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•20 minutes ago•CVE-2026-114155
7.5

CVE-2026-114155: Local Elevation of Privilege via TOCTOU Race Condition in Microsoft .NET dotnet-watch

CVE-2026-114155 is a local elevation of privilege vulnerability affecting Microsoft .NET on Linux and macOS platforms. The vulnerability exists within the dotnet-watch (Hot Reload) component and is caused by a Time-of-Check Time-of-Use (TOCTOU) race condition (CWE-367) during the generation and execution of temporary XML solution files (.slnx) in shared system temporary directories. A local attacker with low privileges can intercept and modify the temporary solution file before MSBuild evaluates it, achieving arbitrary code execution in the security context of the user running dotnet-watch.

Alon Barad
Alon Barad
1 views•9 min read
•about 1 hour ago•CVE-2026-118748
7.5

CVE-2026-118748: Unbounded Memory Allocation Denial of Service in ASP.NET Core Blazor Static-SSR

CVE-2026-118748 is a remote Denial of Service (DoS) vulnerability in Microsoft ASP.NET Core (.NET 11.0 preview releases prior to 11.0.0) and Microsoft Visual Studio 2026 (prior to 18.12.0). The flaw originates from unbounded resource allocation (CWE-770) within the Blazor static server-side rendering (static-SSR) validation pipeline, where dynamic or attacker-supplied form field identifiers are cached in a singleton-scoped memory structure without size limits or eviction policies. Unauthenticated remote attackers can exploit this condition over the network by sending repeated HTTP requests with unique field names, exhausting heap memory and terminating the host process via an unhandled OutOfMemoryException.

Alon Barad
Alon Barad
3 views•9 min read
•about 2 hours ago•CVE-2026-114150
5.9

CVE-2026-114150: Remote Information Disclosure via Uninitialized Pooled Memory in ASP.NET Core Response Buffering

CVE-2026-114150 is a network-accessible information disclosure vulnerability affecting Microsoft ASP.NET Core in .NET 11.0 preview releases and Microsoft Visual Studio 2026 prior to version 18.12.0. The flaw stems from the use of uninitialized resources (CWE-908) within response buffering components, specifically ResponseBufferingStream used by middleware such as HTTP Logging and Output Caching. Because rented memory segments from ArrayPool<byte> or MemoryPool<byte> are not cleared upon return or strictly bounded to the exact written byte count during subsequent reads, residual response payloads from earlier HTTP requests remain in the buffer tail. Downstream consumers or log sinks reading these buffers expose confidential cross-session data, including authentication tokens and personally identifiable information.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 3 hours ago•CVE-2026-114146
9.0

CVE-2026-114146: Elevation of Privilege in ASP.NET Core SignalR Connection Dispatcher

An incorrect authorization vulnerability (CWE-863) exists in the ASP.NET Core SignalR HTTP Connection Dispatcher (`Microsoft.AspNetCore.Http.Connections`). The connection negotiation process failed to bind the authenticated caller identity to the generated connection state, and subsequent transport or message dispatch handlers failed to verify caller consistency. Consequently, an authenticated low-privilege attacker who obtains a valid connection identifier or token can inject messages into or hijack another user's SignalR session, achieving an elevation of privilege across security boundaries.

Alon Barad
Alon Barad
5 views•11 min read
•about 4 hours ago•CVE-2026-109478
7.5

CVE-2026-109478: Algorithmic Complexity Denial of Service in ASP.NET Core Header Parsing

CVE-2026-109478 is a network-accessible Denial of Service (DoS) vulnerability in ASP.NET Core caused by inefficient algorithmic complexity (CWE-407) when parsing comma-separated HTTP request headers. Prior to the patch, the internal helper method ParsingHelpers.GetHeaderSplit repeatedly called StringValues.Concat inside a loop iterating over each comma-separated token. Because StringValues allocates a new array of size k + 1 and copies all existing elements upon each concatenation, processing N tokens incurs O(N^2) time and space complexity. An unauthenticated remote attacker can send HTTP requests with headers containing thousands of short, comma-separated values to exhaust CPU cycles and induce severe Garbage Collection (GC) pauses, rendering the web application unresponsive.

Alon Barad
Alon Barad
6 views•11 min read
•about 5 hours ago•CVE-2026-114147
7.5

CVE-2026-114147: Denial of Service via Memory Leak in ASP.NET Core SignalR Redis Backplane

CVE-2026-114147 is a high-severity Denial of Service (DoS) vulnerability affecting ASP.NET Core and specifically the Microsoft.AspNetCore.SignalR.StackExchangeRedis scale-out provider across .NET 8.0, 9.0, 10.0, and 11.0 preview releases. The vulnerability originates from a string comparison mismatch between internal per-connection group collections and the centralized Redis channel subscription registry, compounded by a race condition during connection teardown. Remote unauthenticated attackers can exploit this flaw to leave orphaned connection contexts and active Redis pub/sub listeners pinned in memory, leading to unbounded memory exhaustion and application process termination.

Amit Schendel
Amit Schendel
3 views•10 min read