{"id":"CVE-2025-25304","aliases":["CVE-2025-25304","GHSA-mp7w-mhcv-673j"],"related":[],"kind":"vulnerability","state":"published","title":"Vega allows Cross-site Scripting via the vlSelectionTuples function","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe `vlSelectionTuples` function can be used to call JavaScript functions, leading to XSS.\n\n### Details\n[`vlSelectionTuples`](https://github.com/vega/vega/blob/b45cf431cd6c0d0c0e1567f087f9b3b55bc236fa/packages/vega-selections/src/selectionTuples.js#L14) calls multiple functions that can be controlled by an attacker, including one call with an attacker-controlled argument.\n\nExample call: `vlSelectionTuples([{datum:<argument>}], {fields:[{getter:<function>}]})`\n\nThis 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`.\n\n### PoC\n```\n{\"$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]}\"}]}\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-02-14T17:33:58.000Z","modified":"2026-06-17T09:00:39.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 5.26.0","status":"affected"}],"vendor":"vega","product":"vega","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.26.0"}],"ecosystem":"npm","package":"vega","purl":"pkg:npm/vega","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.4.2"}],"ecosystem":"npm","package":"vega-selections","purl":"pkg:npm/vega-selections","source":"ghsa"}],"references":[{"url":"https://github.com/vega/vega/security/advisories/GHSA-mp7w-mhcv-673j","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vega/vega/commit/9fb9ea07e27984394e463d286eb73944fa61411e","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vega/vega/blob/b45cf431cd6c0d0c0e1567f087f9b3b55bc236fa/packages/vega-selections/src/selectionTuples.js#L14","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-25304","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vega/vega","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-02-14T19:43:42.653Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-25304","url":"https://www.cve.org/CVERecord?id=CVE-2025-25304","licence":"CVE Terms of Use","modified":"2025-02-14T19:44:24.152Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mp7w-mhcv-673j","url":"https://github.com/advisories/GHSA-mp7w-mhcv-673j","licence":"CC-BY-4.0","modified":"2025-02-14T22:17:54.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-25304","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-25304","licence":"Public domain","modified":"2026-06-17T09:00:39.130Z"}],"updatedAt":"2026-11-25T22:58:54.118Z","epss":{"score":0.00679,"percentile":0.53623,"date":"2026-12-01T12:00:22.000Z"}}