{"answers":{"affected":"2 open source packages ship an affected version, including @udecode/plate-media.","exploited":"There is no known exploitation of CVE-2024-40631 in the wild and no public exploit code.","fix":"Upgrade @udecode/plate-media to 36.0.10 or later.","what":"CVE-2024-40631 is a high-severity cross-site scripting vulnerability in udecode plate, published on 15 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-40631 and fix it if it is affected.\n\nWhat it is: CVE-2024-40631 is a high-severity cross-site scripting vulnerability in udecode plate, published on 15 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-40631 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @udecode/plate-media (npm): affected all versions; fixed in 36.0.10\n- @udecode/plate-media (npm): affected all versions; fixed in 36.0.10\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-40631/ (Markdown: https://insights.sbomify.com/CVE-2024-40631/index.md)","id":"CVE-2024-40631","markdown":"https://insights.sbomify.com/CVE-2024-40631/index.md","name":"CVE-2024-40631","record":{"aliases":["GHSA-h3pq-667x-r789"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":true,"product_category":"React rich-text editor","requires_auth":"low_privilege","summary":"Attackers can execute arbitrary scripts via malicious URLs in media embeds if custom parsers or direct URL usage lack proper sanitization.","user_interaction":"not_required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":8.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Cross-site Scripting (XSS) in media embed element when using custom URL parsers in plate media","id":"CVE-2024-40631","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"xss","year":"2024"},"n_packages":2,"n_references":3,"next":{"headline":"Linkerd potential access to the shutdown endpoint","id":"CVE-2024-40632"},"packages":[{"ecosystem":"npm","fixed":["36.0.10"],"introduced":["0"],"last_affected":[],"package":"@udecode/plate-media","purl":null,"source":"GHSA-h3pq-667x-r789"},{"ecosystem":"npm","fixed":["36.0.10"],"introduced":["0"],"last_affected":[],"package":"@udecode/plate-media","purl":"pkg:npm/%40udecode/plate-media","source":"GHSA-h3pq-667x-r789"}],"prev":{"headline":"HEIF Heap OOB Read in OpenImageIO","id":"CVE-2024-40630"},"products":["plate"],"published":"2024-07-15","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-02","vendors":["udecode"]},"summary":"Attackers can execute arbitrary scripts via malicious URLs in media embeds if custom parsers or direct URL usage lack proper sanitization.","url":"https://insights.sbomify.com/CVE-2024-40631/"}