CVE-2025-25304
JSON

6.9medium

Vega allows Cross-site Scripting via the vlSelectionTuples function

Severity
6.9medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.68% (higher than 53% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-mp7w-mhcv-673j

Description

Vega is a visualization grammar, a declarative format for creating, saving, and sharing interactive visualization designs. Prior to version 5.26.0 of vega and 5.4.2 of vega-selections, the `vlSelectionTuples` function can be used to call JavaScript functions, leading to cross-site scripting.`vlSelectionTuples` calls multiple functions that can be controlled by an attacker, including one call with an attacker-controlled argument. This can be used to call `Function()` with arbitrary JavaScript and the resulting function can be called with `vlSelectionTuples` or using a type coercion to call `toString` or `valueOf`. Version 5.26.0 of vega and 5.4.2 of vega-selections fix this issue.

Affected

Product or packageVersionsReported by
vega vega< 5.26.0CVE List
vega (npm)before 5.26.0GitHub Advisory Database
vega-selections (npm)before 5.4.2GitHub Advisory Database

All scores

GitHub_M6.9medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

Vega is a visualization grammar, a declarative format for creating, saving, and sharing interactive visualization designs. Prior to version 5.26.0 of vega and 5.4.2 of vega-selections, the `vlSelectionTuples` function can be used to call JavaScript functions, leading to cross-site scripting.`vlSelectionTuples` calls multiple functions that can be controlled by an attacker, including one call with an attacker-controlled argument. This can be used to call `Function()` with arbitrary JavaScript and the resulting function can be called with `vlSelectionTuples` or using a type coercion to call `toString` or `valueOf`. Version 5.26.0 of vega and 5.4.2 of vega-selections fix this issue.

GitHub Advisory Database
Summary

The vlSelectionTuples function can be used to call JavaScript functions, leading to XSS.

Details

vlSelectionTuples calls multiple functions that can be controlled by an attacker, including one call with an attacker-controlled argument.

Example call: vlSelectionTuples([{datum:<argument>}], {fields:[{getter:<function>}]})

This can be used to call Function() with arbitrary JavaScript and the resulting function can be called with vlSelectionTuples or using a type coercion to call toString or valueOf.

PoC
{"$schema":"https://vega.github.io/schema/vega/v5.json","signals":[{"name":"a","init":"+{valueOf:vlSelectionTuples([{datum:'alert(1)'}],{fields:[{getter:[].at.constructor}]})[0].values[0]}"}]}
NVD (es)

Vega es una gramática de visualización, un formato declarativo para crear, guardar y compartir diseños de visualización interactivos. Antes de la versión 5.26.0 de vega y 5.4.2 de vega-selections, la función `vlSelectionTuples` se puede utilizar para llamar a funciones de JavaScript, lo que conduce a Cross Site Scripting. `vlSelectionTuples` llama a múltiples funciones que pueden ser controladas por un atacante, incluida una llamada con un argumento controlado por el atacante. Esto se puede utilizar para llamar a `Function()` con JavaScript arbitrario y la función resultante se puede llamar con `vlSelectionTuples` o utilizando una coerción de tipo para llamar a `toString` o `valueOf`. La versión 5.26.0 de vega y 5.4.2 de vega-selections solucionan este problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-25304 changed 2025-02-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-mp7w-mhcv-673j changed 2025-02-14CC-BY-4.0
NVDCVE-2025-25304 changed 2026-06-17Public domain