CVE-2023-46308

9.8 CRITICAL

📋 TL;DR

This CVE describes a prototype pollution vulnerability in plotly.js that allows attackers to modify object prototypes through plot API calls. This affects any web application using vulnerable versions of plotly.js for data visualization. Attackers could potentially execute arbitrary code or cause denial of service.

💻 Affected Systems

Products:
  • plotly.js
  • Plotly Dash
  • Plotly for R
  • Plotly for Python
  • Any application embedding plotly.js
Versions: All versions before 2.25.2
Operating Systems: All platforms running JavaScript
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all configurations using vulnerable plotly.js versions. The vulnerability is in the core library and doesn't require specific configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Denial of service, data manipulation, or privilege escalation within the application context.

🟢

If Mitigated

Limited impact with proper input validation and sandboxing, potentially causing application instability.

🌐 Internet-Facing: HIGH - Web applications using plotly.js are typically internet-facing and accept user-controlled data.
🏢 Internal Only: MEDIUM - Internal applications could still be exploited by authenticated users or through other attack vectors.

🎯 Exploit Status

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

Exploitation requires crafting malicious plot API calls. While no public PoC exists, the vulnerability is well-documented and could be weaponized.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.25.2 and later

Vendor Advisory: https://github.com/plotly/plotly.js/releases/tag/v2.25.2

Restart Required: No

Instructions:

1. Update plotly.js dependency to version 2.25.2 or later. 2. Update package.json or equivalent dependency file. 3. Run npm update plotly.js or equivalent package manager command. 4. Rebuild and redeploy application.

🔧 Temporary Workarounds

Input validation and sanitization

all

Implement strict input validation for all plot API calls to prevent prototype pollution payloads.

// JavaScript example: Validate plot data objects before passing to plotly.js
function sanitizePlotData(data) {
  // Remove __proto__ and similar dangerous properties
  delete data.__proto__;
  delete data.constructor;
  delete data.prototype;
  return data;
}

🧯 If You Can't Patch

  • Implement Content Security Policy (CSP) to restrict script execution
  • Use web application firewall (WAF) rules to block prototype pollution patterns

🔍 How to Verify

Check if Vulnerable:

Check package.json or equivalent for plotly.js version. If version is below 2.25.2, the system is vulnerable.

Check Version:

npm list plotly.js | grep plotly.js

Verify Fix Applied:

Verify plotly.js version is 2.25.2 or higher in package.json and in running application.

📡 Detection & Monitoring

Log Indicators:

  • Unusual plot API calls with __proto__ or constructor properties
  • JavaScript errors related to prototype modification
  • Unexpected object property modifications

Network Indicators:

  • HTTP requests containing __proto__ in plot data payloads
  • Unusual data patterns in plot API endpoints

SIEM Query:

source="web_logs" AND (__proto__ OR constructor.prototype) AND path="*plot*"

🔗 References

📤 Share & Export