CVE-2026-47428
Deferred Deferred - Pending Action

Vitest Browser Mode Arbitrary JavaScript Execution

Vulnerability report for CVE-2026-47428, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-14

Last updated on: 2026-07-15

Assigner: GitHub, Inc.

Description

Vitest is a testing framework powered by Vite. From 4.0.17 until 4.1.6 and 5.0.0-beta.3, Vitest Browser Mode served /__vitest_test__/ with the otelCarrier query parameter inserted directly into an inline module script, allowing a crafted browser-runner URL to execute arbitrary JavaScript in the Vitest server origin and recover VITEST_API_TOKEN for authenticated API calls. This issue is fixed in versions 4.1.6 and 5.0.0-beta.3.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-14
Last Modified
2026-07-15
Generated
2026-08-04
AI Q&A
2026-07-15
EPSS Evaluated
2026-08-02
NVD

Affected Vendors & Products

Showing 6 associated CPEs
Vendor Product Version / Range
vitest vitest to 4.1.6 (inc)
vitest vitest 5.0.0-beta.3
vitest-dev vitest From 4.0.17 (inc) to 4.1.6 (exc)
vitest-dev vitest 4.1.6
vitest-dev vitest 5.0.0-beta.3
vitest-dev vitest From 5.0.0-beta.0 (inc) to 5.0.0-beta.3 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is a reflected cross-site scripting (XSS) flaw in Vitest's browser mode. It occurs because the otelCarrier query parameter is inserted directly into an inline module script without sanitization. This allows attackers to craft malicious URLs that execute arbitrary JavaScript in the Vitest server origin when opened by a victim.

Detection Guidance

This vulnerability is specific to Vitest's browser mode and can be detected by checking the Vitest version in use. If your system runs Vitest versions >=4.0.17 and <4.1.6 or >=5.0.0-beta.0 and <5.0.0-beta.3, it is vulnerable. No direct network or system commands are provided in the context to detect exploitation attempts.

Impact Analysis

An attacker can recover the VITEST_API_TOKEN, which authenticates WebSocket API calls. In local setups, this may lead to remote code execution by modifying the vite.config.ts file through authenticated API calls, causing injected payloads to execute during Vitest reloads.

Compliance Impact

This vulnerability could lead to unauthorized access to sensitive data, violating GDPR's confidentiality requirements and HIPAA's security rules for protected health information. The potential for remote code execution further exacerbates compliance risks.

Mitigation Strategies

Upgrade Vitest to version 4.1.6 or later, or 5.0.0-beta.3 or later. Avoid using vulnerable versions in browser mode. Review server logs for suspicious URLs containing the otelCarrier parameter if you suspect prior exploitation.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-47428. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart