CVE-2025-59840

8.1 HIGH

📋 TL;DR

This vulnerability allows arbitrary JavaScript code execution in Vega visualization applications when two specific conditions are met: the application attaches Vega library and View instances to the global window object, and it accepts user-defined Vega JSON definitions. Applications that use Vega for rendering visualizations from untrusted user input are affected.

💻 Affected Systems

Products:
  • Vega
  • Vega Expression
  • Vega Interpreter
Versions: Vega prior to 6.2.0, Vega Expression prior to 6.1.0/5.2.1, Vega Interpreter prior to 2.2.1/1.2.1
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when both conditions are met: Vega attached to global window AND accepting user-defined JSON definitions. Safe mode expressionInterpreter does not prevent exploitation.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the web application allowing attackers to execute arbitrary JavaScript in the context of the vulnerable application, potentially leading to data theft, session hijacking, or further system compromise.

🟠

Likely Case

Cross-site scripting (XSS) attacks where attackers can inject malicious JavaScript through Vega JSON definitions, compromising user sessions and stealing sensitive data.

🟢

If Mitigated

No impact if applications don't attach Vega to global window and only use trusted JSON definitions.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires the specific vulnerable configuration but is straightforward once conditions are met.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Vega 6.2.0, Vega Expression 6.1.0/5.2.1, Vega Interpreter 2.2.1/1.2.1

Vendor Advisory: https://github.com/vega/vega/security/advisories/GHSA-7f2v-3qq3-vvjf

Restart Required: Yes

Instructions:

1. Identify your Vega version line (6.x or older). 2. For Vega 6.x: Update to vega@6.2.0, vega-expression@6.1.0, and vega-interpreter@2.2.1 (if using AST evaluator). 3. For non-ESM environments: Update to vega-expression@5.2.1 and vega-interpreter@1.2.1 (if using AST evaluator). 4. Restart your application.

🔧 Temporary Workarounds

Remove Global Attachment

all

Do not attach Vega library or View instances to global window variables

Remove any code that attaches vega or vega.View to window object

🧯 If You Can't Patch

  • Restrict Vega JSON definitions to trusted sources only (no user input)
  • Implement strict content security policies (CSP) to limit script execution

🔍 How to Verify

Check if Vulnerable:

Check if your application attaches vega or vega.View to window object AND accepts user-defined Vega JSON definitions

Check Version:

npm list vega vega-expression vega-interpreter

Verify Fix Applied:

Verify package.json shows vega@6.2.0+, vega-expression@6.1.0+/5.2.1+, and vega-interpreter@2.2.1+/1.2.1+ as appropriate

📡 Detection & Monitoring

Log Indicators:

  • Unusual Vega JSON parsing errors
  • JavaScript execution errors from Vega context

Network Indicators:

  • Malformed Vega JSON payloads in requests
  • Unexpected external script loads

SIEM Query:

Search for Vega-related errors or suspicious JSON payloads containing script tags or JavaScript code

🔗 References

📤 Share & Export