CVE-2024-40631
Cross-site Scripting (XSS) in media embed element when using custom URL parsers in plate media
Also known as GHSA-h3pq-667x-r789
Mitigation
- Upgrade @udecode/plate-media to 36.0.10 or later.
Who should check
- Projects that depend on npm package @udecode/plate-media (< 36.0.10)
- Anyone running udecode plate < 36.0.10
Vulnerability facts
- Affected
- @udecode/plate-media < 36.0.10
- Fixed in
- 36.0.10
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, login needed
- CVSS
- 8.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: None
- EPSS
- 0.92% chance of exploitation in 30 days (percentile 59, 2026-11-26)
- CWE
- CWE-79
- Modified
Description
Plate media is an open source, rich-text editor for React. Editors that use `MediaEmbedElement` and pass custom `urlParsers` to the `useMediaState` hook may be vulnerable to XSS if a custom parser allows `javascript:`, `data:` or `vbscript:` URLs to be embedded. Editors that do not use `urlParsers` and consume the `url` property directly may also be vulnerable if the URL is not sanitised. The default parsers `parseTwitterUrl` and `parseVideoUrl` are not affected. `@udecode/plate-media` 36.0.10 resolves this issue by only allowing HTTP and HTTPS URLs during parsing. This affects only the `embed` property returned from `useMediaState`. In addition, the `url` property returned from `useMediaState` has been renamed to `unsafeUrl` to indicate that it has not been sanitised. The `url` property on `element` is also unsafe, but has not been renamed. If you're using either of these properties directly, you will still need to validate the URL yourself. Users are advised to upgrade. Users unable to upgrade should ensure that any custom `urlParsers` do not allow `javascript:`, `data:` or `vbscript:` URLs to be returned in the `url` property of their return values. If `url` is consumed directly, validate the URL protocol before passing it to the `iframe` element.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| npm @udecode/plate-media | < 36.0.10 | 36.0.10 | osv |
| udecode plate | < 36.0.10 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-40631. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-40631.md Affected: @udecode/plate-media < 36.0.10 Fixed in: 36.0.10 Steps: 1. Search this machine and project for @udecode/plate-media (npm), udecode plate: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
FAQ
Is CVE-2024-40631 being exploited?
There is no confirmed exploitation: CVE-2024-40631 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.92% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-40631?
High: CVSS 8.1 (v3.1, scored by CNA). Remote, login needed.
Which versions are affected by CVE-2024-40631?
@udecode/plate-media < 36.0.10.
Is there a fix for CVE-2024-40631?
Yes. Fixed in 36.0.10. Upgrade @udecode/plate-media to 36.0.10 or later.
How do I check if I'm affected by CVE-2024-40631?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.