VYPR
Moderate severityNVD Advisory· Published Mar 27, 2025· Updated Mar 27, 2025

Vega Cross-Site Scripting (XSS) via event filter when not using CSP mode `expressionInterpeter`

CVE-2025-26619

Description

Vega is a visualization grammar, a declarative format for creating, saving, and sharing interactive visualization designs. In vega 5.30.0 and lower and in vega-functions 5.15.0 and lower , it was possible to call JavaScript functions from the Vega expression language that were not meant to be supported. The issue is patched in vega 5.31.0 and vega-functions 5.16.0. Some workarounds are available. Run vega without vega.expressionInterpreter. This mode is not the default as it is slower. Alternatively, using the interpreter described in CSP safe mode (Content Security Policy) prevents arbitrary Javascript from running, so users of this mode are not affected by this vulnerability.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
veganpm
< 5.31.05.31.0
vega-functionsnpm
< 5.16.05.16.0

Affected products

1

Patches

1
8fc129a6f8a1

Merge commit from fork

https://github.com/vega/vegaCameron YickJan 20, 2025via ghsa
2 files changed · +14 11
  • packages/vega-functions/src/functions/scale-gradient.js+7 2 modified
    @@ -3,8 +3,13 @@ import {scale as get, scaleFraction} from 'vega-scale';
     import {Gradient} from 'vega-scenegraph';
     import {identity, peek} from 'vega-util';
     
    -export default function(scale, p0, p1, count, group) {
    -  scale = getScale(scale, (group || this).context);
    +/**
    + * Passing a function is only used for for testing.
    + * Outside of tests, the first argument should be a string.
    + */
    +export default function(scaleOrFunction, p0, p1, count, group) {
    +
    +  let scale = typeof scaleOrFunction === 'string' ? getScale(scaleOrFunction, (group || this).context) : scaleOrFunction;
     
       const gradient = Gradient(p0, p1);
     
    
  • packages/vega-functions/src/scales.js+7 9 modified
    @@ -1,19 +1,17 @@
     import {ScalePrefix} from './constants';
     import {scaleVisitor} from './visitors';
     import {Literal} from 'vega-expression';
    -import {isFunction, isString, stringValue} from 'vega-util';
    +import {isString, stringValue} from 'vega-util';
     import {isRegisteredScale} from 'vega-scale';
     
    -export function getScale(nameOrFunction, ctx) {
    +/**
    + * Name must be a string. Return undefined if the scale is not registered.
    + */
    +export function getScale(name, ctx) {
     
    -  if (isFunction(nameOrFunction)) {
    -    return nameOrFunction;
    -  }
    -
    -  if (isString(nameOrFunction)) {
    -    const maybeScale = ctx.scales[nameOrFunction];
    +  if (isString(name)) {
    +    const maybeScale = ctx.scales[name];
         return (maybeScale && isRegisteredScale(maybeScale.value)) ? maybeScale.value : undefined;
    -
       }
     
       return undefined;
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.