Cross-site Scripting (XSS)Weakness · CWE-79

CVE-2026-47428

CRITICAL · 9.6 CVSS v3.1 Published 2026-07-14
Patch available
A vendor patch is available. No clean upgrade release — apply the published patch.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Patch available 5 weeks old

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 · unedited
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.

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 confidence

Vitest 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.

MitigationUpgrade 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.

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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed Vitest version
    Run `npm list vitest` or check package.json to see the installed Vitest version number
    Affected 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
  2. Confirm Vitest browser mode is in use
    Check your Vitest configuration file (vitest.config.ts/js) for `browser: { enabled: true }` or inspect if tests are run with the `--browser` flag via CLI
    Affected if Browser mode is enabled, as this vulnerability only exists when Vitest serves content in browser mode
  3. Check if Vitest server is network-accessible
    Verify 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 address
    Affected if The Vitest server is accessible from other origins, allowing a crafted URL to reach the vulnerable otelCarrier parameter handler
  4. Verify if VITEST_API_TOKEN is set
    Check 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
  5. Inspect otel-related configuration
    Search your vitest config and any OpenTelemetry setup for `otelCarrier` usage. Check if any custom otel exporter configurations reference this parameter
    Affected 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Patch available Apply the vendor patch
Vendor patch github.com →
Interim mitigation

Upgrade 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.

Recommended fix High confidence

Upgrade to Vitest 4.1.6 (stable) or 5.0.0-beta.3 (beta) or later

  1. 1. Identify the currently installed Vitest version by checking package.json or running `npm list vitest` or `yarn list vitest`
  2. 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. 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. 4. After upgrading, verify the fix by confirming the otelCarrier query parameter is no longer directly inserted into inline script tags
  5. 5. Test that browser mode functionality works correctly after the upgrade
Caveat Beta versions (5.0.0-beta.x) may have breaking changes; test in non-production environment before deploying

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation2.0 h
  • Testing2.0 h
  • Review / QA1.0 h
7.0 hours of engineering $1,240
Get the patch applied

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-47428 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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