{"id":"CVE-2026-112949","published":"2026-10-20T15:19:03Z","modified":"2026-10-23T01:42:51Z","title":"Vitest: Code injection via unauthenticated manual mock registration","vendor":"vitest-dev","product":"vitest","tier":"tail","description":{"text":"Vitest is a Vite-native testing framework for JavaScript and TypeScript projects. From 2.1.0-beta.7 until 4.1.12 and 5.0.3, an unauthenticated non-browser WebSocket client that can reach a development server using interceptorPlugin can register a manual mock whose attacker-controlled url createManualModuleSource inserts unescaped into generated module source. When the developer browser loads the affected module, attacker-controlled JavaScript executes on the development-server origin. This issue is fixed in versions 4.1.12 and 5.0.3.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.7,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00305,"percentile":0.15623,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-116","name":"Improper Encoding or Escaping of Output"},{"id":"CWE-306","name":"Missing Authentication for Critical Functionality"}],"references":[{"url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35","tags":["x_refsource_MISC"]},{"url":"https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473","tags":["x_refsource_MISC"]},{"url":"https://github.com/vitest-dev/vitest/releases/tag/v4.1.12","tags":["x_refsource_MISC"]},{"url":"https://github.com/vitest-dev/vitest/releases/tag/v5.0.3","tags":["x_refsource_MISC"]}],"priority":{"score":6.4,"factors":[{"name":"EPSS percentile","points":3.12},{"name":"CVSS severity","points":3.29}]},"vendorSlug":"vitest-dev","affectedVersions":[{"vendor":"vitest-dev","product":"vitest","versions":[">= 2.1.0-beta.7, < 4.1.12",">= 5.0.0, < 5.0.3"]},{"vendor":"@vitest","product":"mocker","versions":[">= 2.1.0-beta.7, < 4.1.12",">= 5.0.0, < 5.0.3"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-10-23T01:42:18.590758Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"@vitest/mocker","vulnerableRanges":[">=2.1.0-beta.7, <4.1.12",">=5.0.0-beta.1, <5.0.3"],"patched":["4.1.12","5.0.3"],"from":["GHSA-qxg6-89mg-rqv8"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-105148","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-vitest-dev-vitest-cve-2025-24963","parents":[{"from":"CVE-2026-84373","to":"CVE-2026-112949","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"npm:@vitest/mocker","fromFixed":"4.1.11","toFixed":"4.1.12","daysApart":49},{"kind":"version-step","provenance":"source","package":"npm:@vitest/mocker","fromFixed":"5.0.0-rc.2","toFixed":"5.0.3","daysApart":49},{"kind":"same-code","provenance":"machine","files":["packages/mocker/src/node/interceptorPlugin.ts"],"commits":["https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35","https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473","https://github.com/vitest-dev/vitest/commit/51edf2b072902aec6d30c90ebaafd8f121c6f9d8","https://github.com/vitest-dev/vitest/commit/8ff9b9a9efca7c6cfd5243569440de8d7a33aec4"],"basis":"shared function","functions":["InterceptorPluginOptions","interceptorPlugin"]}]}],"packageHistory":[{"cve":"CVE-2026-84373","published":"2026-09-01","fixed":"5.0.0-rc.2","kev":false},{"cve":"CVE-2026-112949","published":"2026-10-20","fixed":"5.0.3","kev":false},{"cve":"CVE-2026-112950","published":"2026-10-20","fixed":"5.0.3","kev":false}],"package":"npm:@vitest/mocker"}}