Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-112949— Vitest: Code injection via unauthenticated manual mock registration

Quick assessment

Affected
vitest-dev vitest
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Vitest 是一个面向 JavaScript 和 TypeScript 项目的、原生基于 Vite 的测试框架。在 2.1.0-beta.7 至 4.1.12 以及 5.0.3 版本中,若存在一个未经认证的、非浏览器的 WebSocket 客户端能够访问开发服务器,并且该服务器使用了 interceptorPlugin,则攻击者可以注册一个手动模拟(manual mock)。攻击者控制的 URL 会被 函数以未转义的方式插入到生成的模块源码中。当开发者的浏览器加载受影响的模块时,攻击者控制的 JavaScript

CVSS 4.7 · Medium

Affected Version Matrix 4

VendorProduct Version RangeStatus
@vitest mocker >= 2.1.0-beta.7, < 4.1.12 affected
>= 5.0.0, < 5.0.3 affected
vitest-dev vitest >= 2.1.0-beta.7, < 4.1.12 affected
>= 5.0.0, < 5.0.3 affected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-112949

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Vitest: Code injection via unauthenticated manual mock registration
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Source: CVE Program / CVE List V5
Vulnerability Type
对生成代码的控制不恰当(代码注入)
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
vitest-dev vitest >= 2.1.0-beta.7, < 4.1.12 -
@vitest mocker >= 2.1.0-beta.7, < 4.1.12 -

II. Public POCs for CVE-2026-112949

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-112949

请登录查看更多情报信息。

Patches & Fixes for CVE-2026-112949 (1)

Vendor Advisories for CVE-2026-112949 (1)

Vendor Pages for CVE-2026-112949 (2)

Same Patch Batch · vitest-dev · 2026-10-20 · 3 CVEs total

CVE-2026-112948 6.5 MEDIUM Vitest: Servers misapply `server.fs.deny`, serving `.env`, private keys, `.git`, and the A
CVE-2026-112950 5.9 MEDIUM Vitest: Windows backslash traversal bypasses the @vitest/mocker redirect allowlist fix

IV. Related Vulnerabilities

V. Comments for CVE-2026-112949

No comments yet


Leave a comment