CVE-2024-40631

8.1 HIGH

📋 TL;DR

This vulnerability allows cross-site scripting (XSS) attacks in React applications using Plate media editor. Attackers can inject malicious JavaScript, data, or VBScript URLs through custom URL parsers or unsanitized URL properties, potentially compromising user sessions. Only applications using custom urlParsers or consuming url/unsafeUrl properties directly are affected.

💻 Affected Systems

Products:
  • @udecode/plate-media
Versions: Versions before 36.0.10
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when using custom urlParsers or consuming url/unsafeUrl properties directly. Default parsers parseTwitterUrl and parseVideoUrl are not affected.

⚠️ 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 account takeover, session hijacking, credential theft, and client-side data exfiltration through malicious script execution in users' browsers.

🟠

Likely Case

Session hijacking, credential theft, and unauthorized actions performed on behalf of authenticated users.

🟢

If Mitigated

Limited to isolated client-side script execution with proper CSP headers and input validation in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

XSS exploitation is well-understood and can be weaponized with minimal effort. No public proof-of-concept identified but technique is standard.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 36.0.10

Vendor Advisory: https://github.com/udecode/plate/security/advisories/GHSA-h3pq-667x-r789

Restart Required: No

Instructions:

1. Update @udecode/plate-media to version 36.0.10 or later. 2. Run npm update @udecode/plate-media or yarn upgrade @udecode/plate-media. 3. Rebuild and redeploy your application.

🔧 Temporary Workarounds

Custom URL Parser Validation

all

Manually validate URLs in custom urlParsers to reject javascript:, data:, and vbscript: protocols

Direct URL Property Sanitization

all

Implement URL protocol validation before passing url/unsafeUrl properties to iframe elements

🧯 If You Can't Patch

  • Implement strict Content Security Policy (CSP) headers to block inline scripts and unsafe eval
  • Validate all URL inputs server-side to reject non-HTTP/HTTPS protocols before processing

🔍 How to Verify

Check if Vulnerable:

Check if using @udecode/plate-media <36.0.10 AND using custom urlParsers OR consuming url/unsafeUrl properties directly without validation

Check Version:

npm list @udecode/plate-media or check package.json version

Verify Fix Applied:

Verify package.json shows @udecode/plate-media version 36.0.10 or higher, and test that javascript:/data:/vbscript: URLs are rejected

📡 Detection & Monitoring

Log Indicators:

  • Unusual iframe src attributes with non-HTTP protocols
  • JavaScript errors from blocked script execution

Network Indicators:

  • Requests to unusual protocols from iframe elements
  • Data URL payloads in network traffic

SIEM Query:

Search for 'javascript:', 'data:', 'vbscript:' in URL parameters and iframe src attributes

🔗 References

📤 Share & Export