CVE-2024-40631
📋 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
- @udecode/plate-media
⚠️ 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.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- 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.
🎯 Exploit Status
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
allManually validate URLs in custom urlParsers to reject javascript:, data:, and vbscript: protocols
Direct URL Property Sanitization
allImplement 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
- https://github.com/udecode/plate/commit/1bc0971774fbfb770780c9bdb94746a6f0f196a0
- https://github.com/udecode/plate/security/advisories/GHSA-h3pq-667x-r789
- https://stackoverflow.com/a/43467144
- https://github.com/udecode/plate/commit/1bc0971774fbfb770780c9bdb94746a6f0f196a0
- https://github.com/udecode/plate/security/advisories/GHSA-h3pq-667x-r789
- https://stackoverflow.com/a/43467144