CVE-2026-112945: Cross-origin script execution through Vite custom middleware

vite Updated 22 Oct 2026

Summary

21/10/2026
Yes i
Low
2.1

CVE-2026-112945: A malicious website can cause attacker-controlled JavaScript to execute in a Vite development page, potentially exposing sensitive values or enabling critical actions. Affects vite across 5 version ranges.

< 6.4.4 >= 7.0.0, < 7.3.7 >= 8.0.0, < 8.1.6 >= 8.2.0, < 8.2.4 >= 8.3.0, < 8.3.3

Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Vite is a JavaScript build tool and development server in the npm ecosystem. Developers use it to serve and transform application code during development. Its middleware mode also allows applications to embed Vite in a custom server, where the application can pass HTML through Vite's transformation process.

Vulnerability Detail

Cross-origin script execution can let a malicious website load attacker-controlled JavaScript in a page served by Vite's development server. The issue affects custom middleware setups that pass an unchanged browser request URL to server.transformIndexHtml and produce HTML containing an inline module script. The attacker can exploit URL handling in the HTML transformation to make the browser request a module from an attacker-controlled origin. Impact depends on whether the application exposes sensitive values or permits critical actions from that page.

How To Fix

Latest published version: 8.3.5 as of 22 Oct 2026

npm install vite@8.3.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 6.4.4 6.4.4
    npm install vite@6.4.4
  • >= 7.0.0, < 7.3.7 7.3.7
    npm install vite@7.3.7
  • >= 8.0.0, < 8.1.6 8.1.6
    npm install vite@8.1.6
  • >= 8.2.0, < 8.2.4 8.2.4
    npm install vite@8.2.4
  • >= 8.3.0, < 8.3.3 8.3.3
    npm install vite@8.3.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

AI-generated workaround (not vendor-documented): For Vite, avoid passing the browser's unchanged request URL to server.transformIndexHtml; use a trusted, normalized path and restrict access to the development server.

Documented mitigation:

const url = req.originalUrl
template = await vite.transformIndexHtml(url, template)

Conclusion

Upgrade Vite to 8.3.3 using the supplied command. The advisory lists separate fixed versions for other Vite release lines, so the appropriate fix depends on the installed line. Review custom middleware integrations that pass browser request URLs into HTML transformation and limit access to development servers. Vulert monitors the dependencies in package-lock.json and alerts when a new vulnerability affects them; check an application at https://vulert.com/scanner.

See every vulnerability recorded for vite →

Share this vulnerability

FAQ

Vite is affected through 8.3.2, 8.2.3, 8.1.5, 7.3.6, and 6.4.3; the advisory also lists vite-plus through 1.0.0.

CVE-2026-112945 can let a malicious website execute attacker-controlled JavaScript in a Vite development page, potentially exposing sensitive values or enabling critical actions.

Upgrade Vite to the minimum fixed version 8.3.3 using the supplied npm command.

For Vite, avoid passing unchanged browser request URLs to server.transformIndexHtml and restrict access to the development server.

Check package-lock.json for Vite and compare its version with the affected ranges. Vulert can scan a manifest or SBOM and monitor the dependency at Vulert Scanner.

Related vulnerabilities

Recent vulnerabilities recorded for vite.

How To Fix

Latest published version: 8.3.5 as of 22 Oct 2026

npm install vite@8.3.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 6.4.4 6.4.4
    npm install vite@6.4.4
  • >= 7.0.0, < 7.3.7 7.3.7
    npm install vite@7.3.7
  • >= 8.0.0, < 8.1.6 8.1.6
    npm install vite@8.1.6
  • >= 8.2.0, < 8.2.4 8.2.4
    npm install vite@8.2.4
  • >= 8.3.0, < 8.3.3 8.3.3
    npm install vite@8.3.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback