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

CVE-2025-59840

HIGH · 8.1 CVSS v3.1 Published 2025-11-13
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
88/100
Remediation priority · High
Remotely reachable No privileges

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
Vega is a visualization grammar, a declarative format for creating, saving, and sharing interactive visualization designs. In Vega prior to version 6.2.0, applications meeting 2 conditions are at risk of arbitrary JavaScript code execution, even if "safe mode" expressionInterpreter is used. They are vulnerable if they use `vega` in an application that attaches `vega` library and a `vega.View` instance similar to the Vega Editor to the global `window` and if they allow user-defined Vega `JSON` definitions (vs JSON that was is only provided through source code). Patches are available in the following Vega applications. If using the latest Vega line (6.x), upgrade to `vega` `6.2.0` / `vega-expression` `6.1.0` / `vega-interpreter` `2.2.1` (if using AST evaluator mode). If using Vega in a non-ESM environment, upgrade to `vega-expression` `5.2.1` / `1.2.1` (if using AST evaluator mode). Some workarounds are available. Do not attach `vega` View instances to global variables, and do not attach `vega` to the global window. These practices of attaching the vega library and View instances may be convenient for debugging, but should not be used in production or in any situation where vega/vega-lite definitions could be provided by untrusted parties.

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

Arbitrary JavaScript code execution vulnerability in Vega visualization library versions prior to 6.2.0. The flaw allows code execution through user-supplied Vega JSON definitions when the vega library and View instances are attached to the global window object, bypassing the safe mode expressionInterpreter.

MitigationUpgrade to vega 6.2.0 (or vega-expression 6.1.0/vega-interpreter 2.2.1 for AST mode), and ensure vega library and View instances are not attached to global window variables in production environments.

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
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

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 the installed Vega library version
    Check your project's package.json file, or run a command to query the vega package version at runtime (e.g., console.log(vega.version) or require('vega/package.json').version)
    Affected if The version is lower than 6.2.0 (e.g., 6.1.x, 6.0.x, 5.x, or earlier)
  2. Determine if the Vega library is exposed on the global window object
    Inspect your application's runtime environment (browser console or Node.js global scope) and search for vega references attached to window (e.g., window.vega, window.Vega, or similar global bindings)
    Affected if The vega library or its exports are assigned to global variables such as window.vega or window.Vega
  3. Determine if View instances are attached to the global window object
    Search your application code and runtime for patterns like window.View, window.vega.View, or any global binding that exposes Vega View instances
    Affected if Vega View constructor or instances are attached to global window variables
  4. Identify if your application accepts and renders user-supplied Vega JSON definitions
    Review your application's data flow to determine whether end-users can provide Vega visualization specifications (JSON schema) that get parsed and rendered by the vega library
    Affected if Your application processes and renders Vega JSON definitions supplied by users without server-side validation
  5. Check if safe mode expressionInterpreter is in use
    Inspect your vega configuration or runtime settings to determine whether the safe mode expressionInterpreter is enabled (typically via vega config options or vega-expression settings)
    Affected if Safe mode is disabled or the expressionInterpreter is configured to allow unsafe execution, and your version is below 6.2.0

You are affected if you are running a Vega library version prior to 6.2.0 and your application exposes the vega library or View instances on the global window object while processing user-supplied Vega JSON definitions.

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
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade to vega 6.2.0 (or vega-expression 6.1.0/vega-interpreter 2.2.1 for AST mode), and ensure vega library and View instances are not attached to global window variables in production environments.

Recommended fix High confidence

vega 6.2.0 (with vega-expression 6.1.0, vega-interpreter 2.2.1 if using AST evaluator mode)

  1. Upgrade the `vega` package to version 6.2.0 or later
  2. If using `vega-expression`, upgrade to version 6.1.0 or later
  3. If using `vega-interpreter` with AST evaluator mode, upgrade to version 2.2.1 or later
  4. For non-ESM environments, ensure `vega-expression` is upgraded to 5.2.1 (or 1.2.1 for older line)
  5. Alternatively, if upgrading is not immediately feasible, apply config workarounds: (1) Do not attach vega View instances to global window variables, (2) Do not attach the vega library to the global window object
Caveat Check release notes for breaking changes between your current version and 6.2.0; ensure any custom expressions orvega JSON schemas are compatible with the new version

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
  • Testing4.0 h
  • Review / QA1.0 h
9.0 hours of engineering $1,540
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,464.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2025-59840 — 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-2025-59840 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