{"answers":{"affected":"10 open source packages ship an affected version, including vega-expression, vega and vega-interpreter.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59840 exists.","fix":"Upgrade vega-expression to a fixed version for your release line: 5.2.1 or 6.1.0.","what":"CVE-2025-59840 is a high-severity cross-site scripting vulnerability in vega, published on 13 Nov 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2025-59840 and fix it if it is affected.\n\nWhat it is: CVE-2025-59840 is a high-severity cross-site scripting vulnerability in vega, published on 13 Nov 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59840 exists.\n\nAffected packages and fixed versions:\n- vega-expression (npm): affected all versions; fixed in 5.2.1\n- vega-expression (npm): affected all versions; fixed in 5.2.1\n- vega-expression (npm): affected from 6.0.0; fixed in 6.1.0\n- vega-expression (npm): affected from 6.0.0; fixed in 6.1.0\n- vega (npm): affected all versions; fixed in 6.2.0\n- vega (npm): affected all versions; fixed in 6.2.0\n- vega-interpreter (npm): affected all versions; fixed in 1.2.1\n- vega-interpreter (npm): affected all versions; fixed in 1.2.1\n- vega-interpreter (npm): affected from 2.0.0; fixed in 2.2.1\n- vega-interpreter (npm): affected from 2.0.0; fixed in 2.2.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-59840/ (Markdown: https://insights.sbomify.com/CVE-2025-59840/index.md)","id":"CVE-2025-59840","markdown":"https://insights.sbomify.com/CVE-2025-59840/index.md","name":"CVE-2025-59840","record":{"aliases":["DEBIAN-CVE-2025-59840","GHSA-7f2v-3qq3-vvjf","UBUNTU-CVE-2025-59840"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":true,"product_category":"Vega visualization library","requires_auth":"none","summary":"Attackers can execute arbitrary JavaScript in Vega applications if the library and View instances are attached to the global window object.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":8.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"description":"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Vega Cross-Site Scripting (XSS) via expressions abusing toString calls in environments using the VEGA_DEBUG global variable","id":"CVE-2025-59840","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"xss","year":"2025"},"n_packages":10,"n_references":1,"next":{"headline":"FlagForgeCTF's Improper Session Handling Allows Access After Logout","id":"CVE-2025-59841"},"packages":[{"ecosystem":"npm","fixed":["6.2.0"],"introduced":["0"],"last_affected":[],"package":"vega","purl":null,"source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["6.2.0"],"introduced":["0"],"last_affected":[],"package":"vega","purl":"pkg:npm/vega","source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["5.2.1"],"introduced":["0"],"last_affected":[],"package":"vega-expression","purl":null,"source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["5.2.1"],"introduced":["0"],"last_affected":[],"package":"vega-expression","purl":"pkg:npm/vega-expression","source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["6.1.0"],"introduced":["6.0.0"],"last_affected":[],"package":"vega-expression","purl":null,"source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["6.1.0"],"introduced":["6.0.0"],"last_affected":[],"package":"vega-expression","purl":"pkg:npm/vega-expression","source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["1.2.1"],"introduced":["0"],"last_affected":[],"package":"vega-interpreter","purl":null,"source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["1.2.1"],"introduced":["0"],"last_affected":[],"package":"vega-interpreter","purl":"pkg:npm/vega-interpreter","source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["2.2.1"],"introduced":["2.0.0"],"last_affected":[],"package":"vega-interpreter","purl":null,"source":"GHSA-7f2v-3qq3-vvjf"},{"ecosystem":"npm","fixed":["2.2.1"],"introduced":["2.0.0"],"last_affected":[],"package":"vega-interpreter","purl":"pkg:npm/vega-interpreter","source":"GHSA-7f2v-3qq3-vvjf"}],"prev":{"headline":"Star Citizen EmbedVideo Extension Stored XSS through wikitext caused by usage of non-reserved data attributes","id":"CVE-2025-59839"},"products":["vega"],"published":"2025-11-13","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-11-14","vendors":["vega"]},"summary":"Attackers can execute arbitrary JavaScript in Vega applications if the library and View instances are attached to the global window object.","url":"https://insights.sbomify.com/CVE-2025-59840/"}