p PatchFirst

CVE-2025-59840

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

This page contains facts from public vulnerability sources. Check the original advisory before updating.

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.

CVSS 8.1 · High · EPSS 0.4% · Fix available

Published
Updated

Stack: system · node

Affected products and versions

  • vega

    Versions
    • vega < 6.2.0: Affected
    • vega-expression >= 6.0.0, < 6.1.0: Affected
    • vega-expression < 5.2.1: Affected
    • vega-interpreter >= 2.0.0, < 2.2.1: Affected
    • vega-interpreter < 1.2.1: Affected

    No fix published

  • vega.js Debian:12

    Versions
    • 5.22.1+ds+~3.1.0-4
    • 5.25.0+ds+~cs5.3.0-1
    • 5.25.0+ds+~cs5.3.0-2
    • 5.25.0+ds+~cs5.3.0-3
    • 5.25.0+ds+~cs5.3.0-4
    • 5.25.0+ds+~cs5.3.0-5
    • 5.28.0+ds+~cs5.3.0-1
    • 5.28.0+ds+~cs5.3.0-2
    • 5.28.0+ds+~cs5.3.0-3
    • 5.33.1+ds+~cs5.3.0-1
    • 5.33.1+ds+~cs5.3.0-2
    • 5.33.1+ds+~cs5.3.0-3
    • 5.33.1+ds+~cs5.3.0-4
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • vega.js Debian:13

    Versions
    • 5.28.0+ds+~cs5.3.0-1
    • 5.28.0+ds+~cs5.3.0-2
    • 5.28.0+ds+~cs5.3.0-3
    • 5.33.1+ds+~cs5.3.0-1
    • 5.33.1+ds+~cs5.3.0-2
    • 5.33.1+ds+~cs5.3.0-3
    • 5.33.1+ds+~cs5.3.0-4
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • vega.js Debian:14

    Versions
    • 5.28.0+ds+~cs5.3.0-1
    • 5.28.0+ds+~cs5.3.0-2
    • 5.28.0+ds+~cs5.3.0-3
    • 5.33.1+ds+~cs5.3.0-1
    • 5.33.1+ds+~cs5.3.0-2
    • 5.33.1+ds+~cs5.3.0-3
    Affected ranges
    • ECOSYSTEM: < 5.33.1+ds+~cs5.3.0-4

    Update to 5.33.1+ds+~cs5.3.0-4

  • vega npm

    Affected ranges
    • SEMVER: < 6.2.0

    Update to 6.2.0

  • vega-expression npm

    Affected ranges
    • SEMVER: ≥ 6.0.0, < 6.1.0

    Update to 6.1.0

  • vega-interpreter npm

    Affected ranges
    • SEMVER: ≥ 2.0.0, < 2.2.1

    Update to 2.2.1

  • vega-interpreter npm

    Affected ranges
    • SEMVER: < 1.2.1

    Update to 1.2.1

  • vega-expression npm

    Affected ranges
    • SEMVER: < 5.2.1

    Update to 5.2.1

  • vega.js Ubuntu:24.04:LTS

    Versions
    • 5.25.0+ds+~cs5.3.0-2
    • 5.25.0+ds+~cs5.3.0-5
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • vega.js Ubuntu:25.10

    Versions
    • 5.28.0+ds+~cs5.3.0-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • vega.js Ubuntu:26.10

    Versions
    • 5.28.0+ds+~cs5.3.0-2
    • 5.33.1+ds+~cs5.3.0-4
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • vega.js Ubuntu:26.04:LTS

    Versions
    • 5.28.0+ds+~cs5.3.0-1
    • 5.28.0+ds+~cs5.3.0-2
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →