Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-66648

CVE-2025-66648: Vega-functions XSS Vulnerability

CVE-2025-66648 is a cross-site scripting flaw in Vega-functions that allows attackers to execute malicious JavaScript via untrusted user input. This article covers the technical details, affected versions, and mitigation.

Updated:

CVE-2025-66648 Overview

CVE-2025-66648 is a Cross-Site Scripting (XSS) vulnerability affecting the vega-functions package, which supplies function implementations for the Vega expression language. Versions prior to 6.1.1 expose an internal function outside the public API that attackers can abuse to execute arbitrary JavaScript in the browser context. Sites that pass untrusted user input into Vega specifications are exposed to client-side script execution. The Content Security Policy (CSP) safe mode provided by vega.expressionInterpreter does not block this attack. The issue is fixed in vega-functions version 6.1.1.

Critical Impact

Attackers can execute arbitrary JavaScript in a victim's browser by supplying crafted Vega expressions, even when CSP safe mode is enabled through vega.expressionInterpreter.

Affected Products

  • vega-functions versions prior to 6.1.1
  • Applications embedding Vega that render user-supplied specifications
  • Node.js and browser deployments consuming the vulnerable package

Discovery Timeline

  • 2026-01-05 - CVE-2025-66648 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-66648

Vulnerability Analysis

The flaw is classified under [CWE-79], improper neutralization of input during web page generation. The vega-functions package exposes an internal helper function that is not part of the documented public API. Attackers can invoke this function from within a Vega expression to bypass the sandboxing the library provides for user-authored specifications. The result is JavaScript execution in the browser context of the hosting application.

Because Vega is commonly embedded in dashboards, notebooks, and data-visualization services, applications that accept user-supplied Vega or Vega-Lite specifications inherit this exposure. The vulnerability requires user interaction, such as loading a page or opening a shared visualization, and the scope changes to affect resources beyond the vulnerable component.

Root Cause

An internal function intended for library-side use is reachable through the Vega expression language. The expression interpreter fails to restrict this function from expressions parsed from user input. Neutralization of the expression tree does not remove the dangerous call path.

Attack Vector

Exploitation is network-based. An attacker crafts a Vega specification containing the malicious expression and delivers it to a target application that renders untrusted Vega input. When a victim loads the visualization, the expression executes, yielding stored or reflected XSS depending on the delivery path. Enabling CSP safe mode via vega.expressionInterpreter does not mitigate the issue, because the vulnerable function remains reachable through the interpreter.

Refer to the GitHub Security Advisory GHSA-m9rg-mr6g-75gm for advisory-level technical detail.

Detection Methods for CVE-2025-66648

Indicators of Compromise

  • Unexpected <script> execution or DOM modifications originating from Vega-rendered elements
  • Outbound requests from browser sessions to attacker-controlled domains following visualization rendering
  • Stored Vega or Vega-Lite specifications containing calls to undocumented internal functions

Detection Strategies

  • Inventory application dependencies and flag any vega-functions version below 6.1.1
  • Scan stored user content for Vega expressions invoking non-public function names
  • Enable browser Content Security Policy reporting to surface script-source violations from visualization pages

Monitoring Recommendations

  • Log and review upload or edit events for Vega specifications submitted by untrusted users
  • Alert on anomalous JavaScript errors or CSP violation reports tied to visualization endpoints
  • Track dependency manifests in CI to detect reintroduction of vulnerable vega-functions releases

How to Mitigate CVE-2025-66648

Immediate Actions Required

  • Upgrade vega-functions to version 6.1.1 or later across all applications and build pipelines
  • Audit user-submitted Vega specifications for expressions referencing undocumented internal functions
  • Rebuild and redeploy front-end bundles that statically include the vulnerable package

Patch Information

The maintainers released vega-functions6.1.1, which removes the abusable code path. Update via your package manager, for example npm install vega-functions@^6.1.1 or yarn add vega-functions@^6.1.1, and verify the resolved version in your lockfile. See the Vega GitHub Security Advisory for release details.

Workarounds

  • No workaround exists other than upgrading to vega-functions6.1.1
  • Using vega.expressionInterpreter in CSP safe mode does not prevent exploitation
  • Restrict acceptance of Vega specifications to trusted users until the upgrade is deployed
bash
# Configuration example
npm install vega-functions@^6.1.1
npm ls vega-functions

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.