CVE-2026-47428
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedVitest 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceVitest Browser Mode contains a parameter injection vulnerability where the otelCarrier query parameter is directly inserted into an inline module script without sanitization. Attackers can craft malicious browser-runner URLs to execute arbitrary JavaScript in the Vitest server origin, enabling theft of VITEST_API_TOKEN used for authenticated API calls.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify installed Vitest versionRun `npm list vitest` or check package.json to see the installed Vitest version numberAffected if The version is below 4.1.6 for the 4.x line, or below 5.0.0-beta.3 for the 5.x line, indicating it may contain the unpatched vulnerability
-
Confirm Vitest browser mode is in useCheck your Vitest configuration file (vitest.config.ts/js) for `browser: { enabled: true }` or inspect if tests are run with the `--browser` flag via CLIAffected if Browser mode is enabled, as this vulnerability only exists when Vitest serves content in browser mode
-
Check if Vitest server is network-accessibleVerify your Vitest server binds to a network interface or is exposed via a proxy. Inspect your config for `server.host` setting or test startup logs for the listening addressAffected if The Vitest server is accessible from other origins, allowing a crafted URL to reach the vulnerable otelCarrier parameter handler
-
Verify if VITEST_API_TOKEN is setCheck environment variables for VITEST_API_TOKEN (e.g., run `echo $VITEST_API_TOKEN` or inspect your CI/CD environment)Affected if A VITEST_API_TOKEN is present in the environment - this is the sensitive credential at risk of theft if the XSS is exploited
-
Inspect otel-related configurationSearch your vitest config and any OpenTelemetry setup for `otelCarrier` usage. Check if any custom otel exporter configurations reference this parameterAffected if The otelCarrier parameter handling is in use or configurable in your test environment, as this is the specific attack vector
Your environment is affected if you run a vulnerable Vitest version (below 4.1.6 or 5.0.0-beta.3) with browser mode enabled and have a VITEST_API_TOKEN configured.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpgrade Vitest to version 4.1.6, 5.0.0-beta.3 or later. If immediate upgrade is not possible, disable Browser Mode and avoid exposing VITEST_API_TOKEN to untrusted network paths.
Upgrade to Vitest 4.1.6 (stable) or 5.0.0-beta.3 (beta) or later
- 1. Identify the currently installed Vitest version by checking package.json or running `npm list vitest` or `yarn list vitest`
- 2. If using Vitest 4.0.x (version 4.0.17 through 4.1.5), upgrade to version 4.1.6 or later using `npm install vitest@^4.1.6` or `yarn add vitest@^4.1.6`
- 3. If using Vitest 5.0.0-beta.1 or 5.0.0-beta.2, upgrade to version 5.0.0-beta.3 or later using `npm install vitest@^5.0.0-beta.3` or `yarn add vitest@^5.0.0-beta.3`
- 4. After upgrading, verify the fix by confirming the otelCarrier query parameter is no longer directly inserted into inline script tags
- 5. Test that browser mode functionality works correctly after the upgrade
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation2.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,984.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-47428 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-47428 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data