CVE-2026-112945

Vite: Cross origin script execution through Vite custom middleware

Published Oct 20, 2026 CVSS 4.0 · 2.1 Low EPSS < 1% KEV · Not listed
Description
Vite is a frontend tooling framework for JavaScript. Prior to 6.4.4, 7.3.7, 8.1.6, 8.2.4, and 8.3.3, applications using custom middleware are vulnerable when they pass an unchanged browser request URL to server.transformIndexHtml. getHtmlFilename uses the query-bearing request URL to resolve an existing local file while preserving attacker-supplied leading slashes in the generated proxy module URL. If the transformed HTML contains an inline module script and a victim browser loads the crafted development-server page, the leading double slash makes the browser fetch and execute an attacker-controlled module in the Vite-served page. This execution can expose sensitive page data or permit critical actions available to the affected application. This issue is fixed in versions 6.4.4, 7.3.7, 8.1.6, 8.2.4, and 8.3.3.

Analysis

AI-generated

Technical impact

This CVE describes a flaw in Vite's custom middleware handling which allows an attacker to craft a URL that is passed unchanged to the server.transformIndexHtml function. The function then generates a proxy module URL that preserves leading slashes from the original request. If the transformed HTML contains an inline module script, the double slash causes the browser to fetch and execute a module from an attacker‑controlled location. This can lead to the execution of arbitrary code within the context of the served page, exposing sensitive data or enabling destructive actions. The weakness corresponds to CWE‑79 and CWE‑80, a type of cross‑site scripting vulnerability.

Affected Systems

Vite and Vite‑Plus versions earlier than 6.4.4, 7.3.7, 8.1.6, 8.2.4, and 8.3.3 are affected. Vendors include vitejs for both Vite and Vite‑Plus. The vulnerability arises when applications use custom middleware without sanitizing request URLs.

Risk and Exploitability

The CVSS score is 2.1, indicating a low severity reference. EPSS data is not available, and the issue is not listed in CISA's KEV catalog. The vulnerability is exploitable by an attacker who can control the development‑server request, such as through a public dev server or by manipulating the request from a trusted user. The exploit requires the presence of an inline module script in the served HTML, but once triggered it results in the loading of a malicious module that executes in the victim's browser context.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to Vite 6.4.4, 7.3.7, 8.1.6, 8.2.4, or 8.3.3 or later to apply the fix.
  • Ensure that any custom middleware used in Vite sanitizes the request URL by stripping leading slashes and query components before passing it to server.transformIndexHtml.
  • Restrict or disable custom middleware usage in production environments to limit the attack surface.
  • Monitor the development server for unexpected double‑slash usage and enforce strict URL validation rules to prevent malicious module loading.

Generated by OpenCVE AI on October 22, 2026 at 19:58 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-9jrq-w75r-8gcw Vite: Cross origin script execution through Vite custom middleware
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-79
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Vitejs
Vitejs vite
Vitejs vite-plus
Vendors & Products Vitejs
Vitejs vite
Vitejs vite-plus
Type Values Removed Values Added
Description Vite is a frontend tooling framework for JavaScript. Prior to 6.4.4, 7.3.7, 8.1.6, 8.2.4, and 8.3.3, applications using custom middleware are vulnerable when they pass an unchanged browser request URL to server.transformIndexHtml. getHtmlFilename uses the query-bearing request URL to resolve an existing local file while preserving attacker-supplied leading slashes in the generated proxy module URL. If the transformed HTML contains an inline module script and a victim browser loads the crafted development-server page, the leading double slash makes the browser fetch and execute an attacker-controlled module in the Vite-served page. This execution can expose sensitive page data or permit critical actions available to the affected application. This issue is fixed in versions 6.4.4, 7.3.7, 8.1.6, 8.2.4, and 8.3.3.
Title Vite: Cross origin script execution through Vite custom middleware
Weaknesses CWE-80
References
Metrics cvssV4_0

{'score': 2.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

  • CWE-80

    Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 28, 2026, 2:11 PM
Reserved
Oct 19, 2026, 9:30 PM
Status
Awaiting Analysis
Published
Oct 20, 2026, 4:17 PM
Modified
Oct 28, 2026, 3:17 PM
Severity
Moderate
Public date
Oct 20, 2026, 3:00 PM