Vulnerabilities in pkg:npm/@ckeditor/ckeditor5-html-embed
PACKAGECVE-2022-31175 is a MODERATE (CVSS 5.8) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @ckeditor/ckeditor5 markdown gfm libraries in the npm ecosystem. The issue involves ckeditor5 cross-site scripting vulnerability caused by the editor instance destroying process. Remediation is available by upgrading affected packages to version 35.0.1.
pkg:npm/@ckeditor/ckeditor5-html-embed
Vulnerability advisories affecting package pkg:npm/@ckeditor/ckeditor5-html-embed. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-42wq-rch8-6f6j | CVE-2022-31175 | MODERATE | CKEditor5 cross-site scripting vulnerability caused by the editor instance destroying process |
CVE-2022-31175 at a Glance
Security Impact
CVSS: 5.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L).
How to Fix CVE-2022-31175
To remediate this vulnerability, upgrade all affected @ckeditor/ckeditor5 markdown gfm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @ckeditor/ckeditor5-markdown-gfm@35.0.1
npm install @ckeditor/ckeditor5-html-support@35.0.1
npm install @ckeditor/ckeditor5-html-embed@35.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @ckeditor/ckeditor5-markdown-gfm
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-31175, inspect your project dependencies using npm:
npm ls @ckeditor/ckeditor5-markdown-gfm
Analyze the terminal output to locate any version of @ckeditor/ckeditor5 markdown gfm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 35.0.1), your application is affected.
Note: The npm ls @ckeditor/ckeditor5-markdown-gfm command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In @ckeditor/ckeditor5 markdown gfm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-31175 Affected @ckeditor/ckeditor5 markdown gfm Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@ckeditor/ckeditor5-markdown-gfm
|
npm |
< 35.0.1
|
35.0.1
|
|
@ckeditor/ckeditor5-html-support
|
npm |
< 35.0.1
|
35.0.1
|
|
@ckeditor/ckeditor5-html-embed
|
npm |
< 35.0.1
|
35.0.1
|
References
Frequently Asked Questions
What is CVE-2022-31175?
Which @ckeditor/ckeditor5 markdown gfm versions are affected?
What version fixes CVE-2022-31175?
Is @ckeditor/ckeditor5-markdown-gfm affected?
Is @ckeditor/ckeditor5-html-support affected?
What is the CVSS score of CVE-2022-31175?
What CWE is associated with CVE-2022-31175?
How can I check npm dependencies for CVE-2022-31175?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-42wq-rch8-6f6j",
"modified" : "2022-08-11T18:08:35Z",
"published" : "2022-08-06T09:40:43Z",
"aliases" : [ "CVE-2022-31175" ],
"summary" : "CKEditor5 cross-site scripting vulnerability caused by the editor instance destroying process",
"details" : "### Affected packages\n@ckeditor/ckeditor5-markdown-gfm\n@ckeditor/ckeditor5-html-support\n@ckeditor/ckeditor5-html-embed\n\n### Impact\nA cross-site scripting vulnerability has been discovered affecting three optional CKEditor 5's packages. The vulnerability allowed to trigger a JavaScript code after fulfilling special conditions:\n\na) 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,\nb) Initializing the editor on an element and using an element other than `<textarea>` as a base,\nc) Destroying the editor instance.\n\nThe 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. \n\nThis vulnerability might affect a small percent of integrators that depend on dynamic editor initialization/destroy and use [Markdown](https://ckeditor.com/docs/ckeditor5/latest/features/markdown.html), [General HTML Support](https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support.html) or [HTML embed](https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html) features.\n\n### Patches\nThe problem has been recognized and patched. The fix will be available in version 35.0.1.\n\n### For more information\nEmail us at [security@cksource.com](mailto:security@cksource.com) if you have any questions or comments about this advisory.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@ckeditor/ckeditor5-markdown-gfm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "35.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@ckeditor/ckeditor5-html-support"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "35.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@ckeditor/ckeditor5-html-embed"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "35.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ckeditor/ckeditor5/security/advisories/GHSA-42wq-rch8-6f6j"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31175"
}, {
"type" : "WEB",
"url" : "https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support.html"
}, {
"type" : "WEB",
"url" : "https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html"
}, {
"type" : "WEB",
"url" : "https://ckeditor.com/docs/ckeditor5/latest/features/markdown.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ckeditor/ckeditor5"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-08-06T09:40:43Z",
"nvd_published_at" : "2022-08-03T19:15:00Z"
}
}