{"schemaVersion":3,"id":"CVE-2026-112949","aliases":["GHSA-qxg6-89mg-rqv8"],"status":"published","duplicateOf":null,"title":null,"description":"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.","dates":{"published":"2026-10-20T15:19:03.799Z","modified":"2026-10-20T15:19:03.799Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":4.7,"severity":"medium","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":4.7,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":4.7,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Npm","score":4.7,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","exploitability":4.1,"impact":4.5,"computed":true}]},"epss":{"probability":0.00242,"percentile":0.14441,"severity":"low","asOf":"2026-10-21T00:00:00.000Z","change":{"pp":null,"baselineDate":null,"baselineScore":null},"history":[{"date":"2026-10-21T00:00:00.000Z","score":0.00242,"percentile":0.14441}],"last30":[{"date":"2026-10-21T00:00:00.000Z","score":0.00242,"percentile":0.14441}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-94","name":"Improper Control of Generation of Code ('Code Injection')","description":"The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"Medium","url":"https://cwe.mitre.org/data/definitions/94.html"},{"id":"CWE-116","name":"Improper Encoding or Escaping of Output","description":"The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.","type":"weakness","status":"Draft","abstraction":"Class","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/116.html"},{"id":"CWE-306","name":"Missing Authentication for Critical Function","description":"The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/306.html"}],"affected":[{"vendor":"@vitest","product":"mocker","name":"@vitest/mocker","label":"mocker","ecosystem":"Npm","cpePart":null,"purl":"pkg:npm/@vitest/mocker","purlType":"npm","versions":[{"text":"≥ 2.1.0-beta.7, < 4.1.12","noFixRecorded":false,"fixedIn":null},{"text":"≥ 5.0.0-beta.1, < 5.0.3","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 2.1.0-beta.7, < 4.1.12 | ≥ 5.0.0-beta.1, < 5.0.3","eol":null,"hubHref":null},{"vendor":"vitest-dev","product":"vitest","name":"vitest","label":"vitest","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 2.1.0-beta.7, < 4.1.12","noFixRecorded":false,"fixedIn":null},{"text":"≥ 5.0.0, < 5.0.3","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 2.1.0-beta.7, < 4.1.12 | ≥ 5.0.0, < 5.0.3","eol":null,"hubHref":"/vendor/vitest-dev/vitest"},{"vendor":"@vitest","product":"mocker","name":"mocker","label":"mocker","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 2.1.0-beta.7, < 4.1.12","noFixRecorded":false,"fixedIn":null},{"text":"≥ 5.0.0, < 5.0.3","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 2.1.0-beta.7, < 4.1.12 | ≥ 5.0.0, < 5.0.3","eol":null,"hubHref":"/vendor/vitest/mocker"}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8","label":"github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8","hostname":"github.com","tags":["X Refsource CONFIRM","WEB"]},{"url":"https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35","label":"github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35","hostname":"github.com","tags":["X Refsource MISC","WEB"]},{"url":"https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473","label":"github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473","hostname":"github.com","tags":["X Refsource MISC","WEB"]},{"url":"https://github.com/vitest-dev/vitest/releases/tag/v4.1.12","label":"github.com/vitest-dev/vitest/releases/tag/v4.1.12","hostname":"github.com","tags":["X Refsource MISC","WEB"]},{"url":"https://github.com/vitest-dev/vitest/releases/tag/v5.0.3","label":"github.com/vitest-dev/vitest/releases/tag/v5.0.3","hostname":"github.com","tags":["X Refsource MISC","WEB"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112949","label":"nvd.nist.gov/vuln/detail/CVE-2026-112949","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/vitest-dev/vitest","label":"github.com/vitest-dev/vitest","hostname":"github.com","tags":["PACKAGE"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2026-10-20T15:19:03.799Z","label":"Published","detail":"Vulnerability first disclosed.","source":null}],"risk":{"score":19,"level":"low","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-22T12:34:23.359Z","stale":false,"partial":false}}