# CVE-2025-59840: Vega Cross-Site Scripting (XSS) via expressions abusing toString calls in environments using the VEGA_DEBUG global variable

- Severity: High 8.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.42%, higher than 38% of CVEs (2026-12-01)
- Published: 2025-11-13T19:54:26.256Z
- Modified: 2026-10-19T13:10:00.110Z
- Also known as: GHSA-7f2v-3qq3-vvjf
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- vega vega: 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
- vega (npm): before 6.2.0
- vega-expression (npm): from 6.0.0 before 6.1.0; before 5.2.1
- vega-interpreter (npm): from 2.0.0 before 2.2.1; before 1.2.1

## Every score

- GitHub_M: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`

## References

- <https://github.com/vega/vega/security/advisories/GHSA-7f2v-3qq3-vvjf> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-59840> (advisory)
- <https://github.com/vega/editor/blob/e102355589d23cdd0dbfd607a2cc5f9c5b7a4c55/src/components/renderer/renderer.tsx#L239> (web)
- <https://github.com/vega/editor/blob/e102355589d23cdd0dbfd607a2cc5f9c5b7a4c55/src/index.tsx#L14-L16> (web)
- <https://github.com/vega/vega> (package)
- <https://vega.github.io/editor/#/url/vega/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykSArJQBWENgDsQAGhAB3GgBN6aAMwCADDPg0yWVRplIGmNhBoAvOGhDiJVmQrjQATjRyZ2k9ABU2ZMgA2cAAEAELGJpIyZmTiSAEQaADaoHEIVugm-kHSIMTxDBmYzoUyEsmgcKTimImooJgAnjgZIFABNFAA1rnIzl1prVA0zu1WAL4yDDgKSJitWYEhAPzBAGbxECGowcWFIOMAupOpSOnWSAoKAGI0AfPOueWoKSBVcDV1Dc2tCGwMWz+pFyYgYo1a8nECjYsgOUxmc1aAApgCYAMrFGjiMiod41SjEGhwWSUABqAFEAOIAQQA+gARcmhACqlIJfEoAGEkOJ8hAABI8hRBZyUHDONgmJotSgSKTBPGYAByZzguOqmAJRJJUAkYiClACfiktJgQpF+GADChcDWWLgClQAHJ4nBnJgkWxXLRxMEANTBAAGwQAGmi0cEJMFSM4zFHAwGKTSGUzWWSqXSKQAlNEASQA8kqAJROyam81u3M2gAe6o+msJxMoVXi4yLfoAjAdjscgA> (web)
- <https://vega.github.io/vega/usage/interpreter> (web)

## Sources

- CVE List: [CVE-2025-59840](https://www.cve.org/CVERecord?id=CVE-2025-59840), CVE Terms of Use, modified 2025-11-14
- GitHub Advisory Database: [GHSA-7f2v-3qq3-vvjf](https://github.com/advisories/GHSA-7f2v-3qq3-vvjf), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-59840](https://nvd.nist.gov/vuln/detail/CVE-2025-59840), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-59840 · Whole record: https://cve.day/CVE-2025-59840.json · Rebuilt by cve.day 2026-11-25T22:59:07.652Z
