{"id":"CVE-2025-59840","published":"2025-11-13T19:54:26Z","modified":"2025-11-14T16:00:05Z","title":"Vega Cross-Site Scripting (XSS) via expressions abusing toString calls in environments using the VEGA_DEBUG global…","vendor":"vega","product":"vega","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00645,"percentile":0.45492,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/vega/vega/security/advisories/GHSA-7f2v-3qq3-vvjf","tags":["x_refsource_CONFIRM"]}],"priority":{"score":14.8,"factors":[{"name":"EPSS percentile","points":9.1},{"name":"CVSS severity","points":5.67}]},"vendorSlug":"vega","affectedVersions":[{"vendor":"vega","product":"vega","versions":["vega < 6.2.0","vega-expression >= 6.0.0, < 6.1.0","vega-expression < 5.2.1","vega-interpreter >= 2.0.0, < 2.2.1","vega-interpreter < 1.2.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-11-14T15:59:50.261188Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"vega","vulnerableRanges":["<6.2.0"],"patched":["6.2.0"],"from":["GHSA-7f2v-3qq3-vvjf"],"provenance":"source"},{"ecosystem":"npm","package":"vega-expression","vulnerableRanges":[">=6.0.0, <6.1.0","<5.2.1"],"patched":["6.1.0","5.2.1"],"from":["GHSA-7f2v-3qq3-vvjf"],"provenance":"source"},{"ecosystem":"npm","package":"vega-interpreter","vulnerableRanges":[">=2.0.0, <2.2.1","<1.2.1"],"patched":["2.2.1","1.2.1"],"from":["GHSA-7f2v-3qq3-vvjf"],"provenance":"source"}],"summary":{"text":"Vega versions prior to 6.2.0 contain a cross-site scripting flaw in the Vega visualization grammar library, exploitable through expressions that abuse toString calls in applications that attach the vega library and a vega.View instance to the global window object. An attacker who can get a user to interact with a crafted Vega JSON definition (for example, one supplied to an application that accepts user-defined Vega specifications) can execute arbitrary JavaScript in the victim's browser, even when the safe-mode expression interpreter is enabled, and no authentication is required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:41:37Z"},"euvd":{"id":"EUVD-2025-175359","exploited":false,"provenance":"source"}}