CVE-2022-31175 — @ckeditor/ckeditor5-markd…
MEDIUMCVE-2022-31175 is a medium-severity (CVSS 5.8) Cross-site Scripting (XSS) vulnerability in @ckeditor/ckeditor5-markdown-gfm. A fix is available for @ckeditor/ckeditor5-markdown-gfm — see the affected versions and patch details below.
Cross-site scripting caused by the editor instance destroying process in ckeditor5
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-31175.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@ckeditor/ckeditor5-markdown-gfmnpm@ckeditor/ckeditor5-html-supportnpm@ckeditor/ckeditor5-html-embednpmDescription
CKEditor 5 is a JavaScript rich text editor. A cross-site scripting vulnerability has been discovered affecting three optional CKEditor 5's packages in versions prior to 35.0.1. The vulnerability allowed to trigger a JavaScript code after fulfilling special conditions. The affected packages are @ckeditor/ckeditor5-markdown-gfm, @ckeditor/ckeditor5-html-support, and @ckeditor/ckeditor5-html-embed. The specific conditions are 1) Using one of the affected packages. In case of ckeditor5-html-support and ckeditor5-html-embed, additionally, it was required to use a configuration that allows unsafe markup inside the editor. 2) Destroying the editor instance and 3) Initializing the editor on an element and using an element other than <textarea> as a base. The root cause of the issue was a mechanism responsible for updating the source element with the markup coming from the CKEditor 5 data pipeline after destroying the editor. This vulnerability might affect a small percent of integrators that depend on dynamic editor initialization/destroy and use Markdown, General HTML Support or HTML embed features. The problem has been recognized and patched. The fix is available in version 35.0.1. There are no known workarounds for this issue.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @ckeditor/ckeditor5-markdown-gfm | all versions | 35.0.1npm install @ckeditor/ckeditor5-markdown-gfm@35.0.1 |
| 📦npm | @ckeditor/ckeditor5-html-support | all versions | 35.0.1npm install @ckeditor/ckeditor5-html-support@35.0.1 |
| 📦npm | @ckeditor/ckeditor5-html-embed | all versions | 35.0.1npm install @ckeditor/ckeditor5-html-embed@35.0.1 |
Affected Products
ckeditor5-html-embedckeditorckeditor5-html-supportckeditorckeditor5-markdown-gfmckeditorDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @ckeditor/ckeditor5-markdown-gfm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @ckeditor/ckeditor5-markdown-gfm to 35.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-31175 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2022-31175 in your dependencies?
Find it across npm, including transitive dependencies.