CVE-2025-59840
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 · uneditedVega 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 confidenceArbitrary 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.
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 checksWork through these to decide whether this CVE applies to you.
-
Identify the installed Vega library versionCheck 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)
-
Determine if the Vega library is exposed on the global window objectInspect 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
-
Determine if View instances are attached to the global window objectSearch your application code and runtime for patterns like window.View, window.vega.View, or any global binding that exposes Vega View instancesAffected if Vega View constructor or instances are attached to global window variables
-
Identify if your application accepts and renders user-supplied Vega JSON definitionsReview 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 libraryAffected if Your application processes and renders Vega JSON definitions supplied by users without server-side validation
-
Check if safe mode expressionInterpreter is in useInspect 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.
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 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.
vega 6.2.0 (with vega-expression 6.1.0, vega-interpreter 2.2.1 if using AST evaluator mode)
- Upgrade the `vega` package to version 6.2.0 or later
- If using `vega-expression`, upgrade to version 6.1.0 or later
- If using `vega-interpreter` with AST evaluator mode, upgrade to version 2.2.1 or later
- For non-ESM environments, ensure `vega-expression` is upgraded to 5.2.1 (or 1.2.1 for older line)
- 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
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation2.0 h
- Testing4.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 $2,464.
Scan for this in your stack
Free · runs locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-59840 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