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 package | Versions | Reported by |
|---|---|---|
| vega vega | < 5.26.0 | CVE List |
| vega (npm) | before 5.26.0 | GitHub Advisory Database |
| vega-selections (npm) | before 5.4.2 | GitHub Advisory Database |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| GitHub | medium CVSS:4.0 | CVSS: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
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-25304 changed 2025-02-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mp7w-mhcv-673j changed 2025-02-14 | CC-BY-4.0 |
| NVD | CVE-2025-25304 changed 2026-06-17 | Public domain |