CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2025-66648
7.20.04%

Vega Expression Context Leakage Leading to XSS via `setdata`

Amit Schendel
Amit Schendel
Senior Security Researcher

Feb 28, 2026·5 min read·31 visits

PoC Available

Executive Summary (TL;DR)

CVE-2025-66648 is a High-severity XSS vulnerability in Vega versions prior to 6.1.1. Attackers can execute arbitrary JavaScript by injecting a malicious signal handler that traverses the `event` object to access the global `window` context. This affects applications rendering untrusted Vega specifications.

A critical vulnerability exists in the `vega-functions` package, a core dependency of the Vega visualization grammar. The flaw permits attackers to escape the expression sandbox by leveraging object context leakage within signal handlers. Specifically, the `setdata` function (which utilizes the internal `modify` method) allows the execution of arbitrary JavaScript functions found via property traversal on the `event` object. This bypasses standard expression interpretation safeguards, including the 'CSP-safe' interpreter, enabling Cross-Site Scripting (XSS) when rendering user-supplied visualization specifications.

Vulnerability Overview

The Vega visualization grammar allows users to define interactive visualizations using a JSON specification. To support interactivity, Vega includes an expression language that evaluates logic within signal handlers. While Vega implements an expression interpreter to restrict execution to a safe subset of JavaScript, CVE-2025-66648 reveals a bypass in this sandbox mechanism located within the vega-functions component.

The vulnerability manifests in the setdata expression function, which is designed to modify data tuples dynamically. The flaw allows an attacker to manipulate the test predicate argument of the underlying modify function. By traversing properties available on the event object—specifically accessing the internal Dataflow graph and the DOM element—an attacker can reach the global window object. This effectively grants access to native browser APIs (e.g., fetch, alert) and enables arbitrary code execution in the context of the application rendering the chart.

Root Cause Analysis

The root cause is a combination of object context leakage and insufficient validation of function arguments within the internal modify() function. When a signal event triggers, Vega exposes an event object to the expression scope. This object inadvertently retains references to internal engine structures that should be opaque to the user.

Specifically, the event object links to the dataflow instance, which in turn holds a reference to the underlying DOM element (_el). From a DOM element, standard JavaScript property traversal allows access to ownerDocument and defaultView, effectively leaking the global window object. The modify(name, insert, remove, toggle, test, values) function failed to validate that its test argument was a safe, internal predicate. Instead, it accepted any function reference passed to it and executed that function against data tuples during the dataflow propagation cycle.

Code Analysis

The vulnerability lies in how vega-functions handles arguments passed to the setdata (and underlying modify) function without scrutinizing the origin of the predicate function. Below is a conceptual representation of the vulnerable logic versus the patched approach.

Vulnerable Logic

The unpatched version allowed the test parameter to be any callable function derived from the expression scope, including those reachable via the prototype chain or object traversal.

// Conceptual vulnerable implementation in vega-functions
function modify(name, insert, remove, toggle, test, values) {
  // ... lookup dataset by name ...
  
  // The 'test' function is invoked directly without verifying it is safe
  if (test && test(tuple)) {
    // modify tuple
  }
}

Patched Logic (v6.1.1)

The fix introduces strict validation to ensure arguments are expected types and blocks access to sensitive internal properties like _el on the dataflow object. The patch likely sanitizes the event object before exposing it to the expression scope or explicitly validates that the test function is a generated internal predicate rather than a user-supplied reference to window methods.

// Conceptual patched implementation
function modify(name, insert, remove, toggle, test, values) {
  // Validation: Ensure 'test' is not a native function or external reference
  if (test && !isInternalPredicate(test)) {
     throw new Error("Illegal argument to setdata");
  }
 
  // Hardening: The 'event' object passed to expressions no longer exposes '_el'
  // event.dataflow._el => undefined
}

Exploitation

Exploitation requires the attacker to supply a malicious Vega JSON specification to a target application. The payload leverages a signal handler listening for standard user interaction events (like click or mouseover) to trigger the execution chain.

The attacker constructs a setdata call that walks the property chain from event to window. The payload demonstrates executing alert(), but a real-world attack would likely use fetch() to exfiltrate tokens or eval() (if CSP permits) to execute complex payloads.

Proof of Concept

{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "signals": [
    {
      "name": "triggerXSS",
      "on": [
        {
          "events": "click",
          "update": "setdata('table', [], [], [], event.dataflow._el.ownerDocument.defaultView.alert('XSS'))"
        }
      ]
    }
  ],
  "data": [
    { "name": "table", "values": [{"id": 1}] }
  ]
}

> [!WARNING] > CSP Safe Mode Bypass: This vulnerability bypasses vega.expressionInterpreter. Even if an application explicitly uses the interpreter to avoid eval() and adhere to Content Security Policy, this specific vector succeeds because it relies on existing function references (window.alert) rather than string-to-code compilation.

Impact Assessment

The impact of this vulnerability is high (CVSS 7.2) because it allows for Stored XSS or Reflected XSS depending on how the application loads Vega specifications.

Confidentiality: Attackers can read sensitive data from the DOM, including session cookies (if not HttpOnly), LocalStorage tokens, and CSRF tokens.

Integrity: Attackers can modify the visual content of the dashboard to mislead users or inject phishing forms overlaying the legitimate application interface.

Scope: This affects any system integrating Vega or Vega-Lite where users can save or share visualizations. Common targets include data science notebooks (Jupyter), business intelligence dashboards (Kibana), and wiki-style documentation systems integrating Vega rendering.

Remediation

The only effective remediation is to upgrade the vulnerable dependencies.

  • Component: vega-functions
  • Fixed Version: 6.1.1
  • Parent Package: vega (Fixed in 5.30.0 or equivalent depending on dependency tree resolution)

Developers should verify their lockfiles (package-lock.json or yarn.lock) to ensure that transitive dependencies of vega are resolved to vega-functions version 6.1.1 or higher. No configuration changes or workarounds are available; the code itself must be patched to prevent the context leakage.

Official Patches

VegaCommit d67c1b7 fixing the object traversal issue

Fix Analysis (1)

Technical Appendix

CVSS Score
7.2/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
EPSS Probability
0.04%
Top 86% most exploited

Affected Systems

Vega < 6.1.1Vega-Lite (via transitive dependency)Kibana (versions using affected Vega)JupyterLab (versions using affected Vega)Altair (Python wrapper generating Vega specs)

Affected Versions Detail

Product
Affected Versions
Fixed Version
vega-functions
Vega Project
< 6.1.16.1.1
AttributeDetail
CWE IDCWE-79
Attack VectorNetwork
CVSS v3.17.2 (High)
EPSS Score0.00045
Exploit MaturityProof-of-Concept
ImpactArbitrary Code Execution (Browser Context)

MITRE ATT&CK Mapping

T1189Drive-by Compromise
Initial Access
T1059.007Command and Scripting Interpreter: JavaScript
Execution
CWE-79
Cross-site Scripting

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Known Exploits & Detection

GitHub Security AdvisoryPoC demonstrating alert() execution via setdata

Vulnerability Timeline

Fix committed to Vega repository
2025-12-05
GHSA and CVE published
2026-01-05
NVD Analysis Completed
2026-02-05

References & Sources

  • [1]GHSA-m9rg-mr6g-75gm
  • [2]NVD CVE-2025-66648

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.