Cross-site scripting caused by the editor instance destroying process in ckeditor5
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 `` 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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2022-31175
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 5 Nov 2026, 00:07 UTC · Revision 1
Source evidence
Cross-site scripting caused by the editor instance destroying process in ckeditor5
core-osv · Original sourcePublished 3 Aug 2022, 19:05 UTC
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 `` 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.
osv:CVE-2022-31175
Complete source record
{
"id": "46c03feba18b13b5714d32aedc2fd10e44e3eaba8de6c0e61392e62a1c6a23d5",
"url": "https://osv.dev/vulnerability/CVE-2022-31175",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Cross-site scripting caused by the editor instance destroying process in ckeditor5",
"summary": "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 `` 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.",
"evidence": "osv:CVE-2022-31175",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2022-31175",
"aliases": [
"CVE-2022-31175",
"GHSA-42wq-rch8-6f6j"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/ckeditor/ckeditor5",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "19e609434f1fbc0755236d06b39dd8e9b0f8376a"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "35.0.1"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"cpe": "cpe:2.3:a:ckeditor:ckeditor5-markdown-gfm:*:*:*:*:*:node.js:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "35.0.1"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"v35.0.0",
"v19.1.1",
"v19.0.0",
"v18.0.0",
"v17.0.0",
"v16.0.0",
"v15.0.0",
"v12.3.1",
"v12.3.0",
"v12.2.0",
"v12.1.0",
"v12.0.0",
"v11.2.0",
"v11.1.1",
"v11.1.0",
"v11.0.0",
"v10.1.0",
"10.1.0",
"v10.0.0",
"v1.0.0-beta.4",
"v1.0.0-beta.2",
"v1.0.0-beta.1",
"v1.0.0-alpha.2",
"v1.0.0-alpha.1",
"v0.11.0",
"v0.10.0",
"v0.9.0",
"v0.7.0",
"v0.6.0",
"v0.5.0",
"v0.4.0",
"v0.3.0",
"v0.2.0",
"v0.1.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-31175.json"
}
}
],
"modified": "2026-10-28T02:30:40.582359966Z",
"provider": "osv",
"references": [
"https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support.html",
"https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html",
"https://ckeditor.com/docs/ckeditor5/latest/features/markdown.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31175.json",
"https://github.com/ckeditor/ckeditor5/security/advisories/GHSA-42wq-rch8-6f6j",
"https://nvd.nist.gov/vuln/detail/CVE-2022-31175"
],
"provider_metadata": {
"cwe_ids": [
"CWE-79"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31175.json"
}
},
"related_cves": [
{
"value": "CVE-2022-31175",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 508264,
"published_at": "2022-08-03T19:05:13+00:00"
}