GHSA-5vm8-hhgr-jcjp: Tinymce Cross-Site Scripting Vulnerability
MODERATEGHSA-5vm8-hhgr-jcjp is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Tinymce libraries in the npm ecosystem. The issue involves cross-site scripting vulnerability in tinymce. Remediation is available by upgrading affected packages to version 5.7.1.
GHSA-5vm8-hhgr-jcjp at a Glance
How to Fix GHSA-5vm8-hhgr-jcjp
To remediate this vulnerability, upgrade all affected Tinymce 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 tinymce@5.7.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls tinymce
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-5vm8-hhgr-jcjp, inspect your project dependencies using npm:
npm ls tinymce
Analyze the terminal output to locate any version of Tinymce in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.7.1), your application is affected.
Note: The npm ls tinymce 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 Tinymce, 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
GHSA-5vm8-hhgr-jcjp Affected Tinymce Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tinymce
|
npm |
< 5.7.1
|
5.7.1
|
References
Frequently Asked Questions
What is GHSA-5vm8-hhgr-jcjp?
Which Tinymce versions are affected?
What version fixes GHSA-5vm8-hhgr-jcjp?
Is tinymce affected?
What CWE is associated with GHSA-5vm8-hhgr-jcjp?
How can I check npm dependencies for GHSA-5vm8-hhgr-jcjp?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5vm8-hhgr-jcjp",
"modified" : "2021-05-27T21:29:43Z",
"published" : "2021-05-28T19:18:53Z",
"aliases" : [ ],
"summary" : "Cross-site scripting vulnerability in TinyMCE",
"details" : "### Impact\nA cross-site scripting (XSS) vulnerability was discovered in the URL sanitization logic of the core parser for `form` elements. The vulnerability allowed arbitrary JavaScript execution when inserting a specially crafted piece of content into the editor using the clipboard or APIs, and then submitting the form. However, as TinyMCE does not allow forms to be submitted while editing, the vulnerability could only be triggered when the content was previewed or rendered outside of the editor. This impacts all users who are using TinyMCE 5.7.0 or lower.\n\n### Patches\nThis vulnerability has been patched in TinyMCE 5.7.1 by improved URL sanitization logic.\n\n### Workarounds\nTo work around this vulnerability, either:\n- Upgrade to TinyMCE 5.7.1 or higher\n- Manually sanitize `form` URL attributes using a [TinyMCE node filter](https://www.tiny.cloud/docs/api/tinymce.html/tinymce.html.domparser/#addnodefilter).\n- Disable `form` elements in your content using the [invalid_elements](https://www.tiny.cloud/docs/configure/content-filtering/#invalid_elements) setting.\n\n#### Example: Sanitizing using a node filter\n```js\neditor.parser.addNodeFilter('form', function(nodes) {\n nodes.forEach(function(node) {\n if (node.attributes) {\n node.attributes.forEach(function(attr) {\n var name = attr.name;\n var value = attr.value;\n // Sanitize the attribute value here or remove it entirely\n var sanitizedValue = ...;\n node.attr(name, santizedValue);\n });\n }\n });\n});\n```\n\n#### Example: Using invalid_elements\n```js\ninvalid_elements: 'form'\n```\n\n### Acknowledgements\nTiny Technologies would like to thank Mikhail Khramenkov at Solar Security Research Team for discovering this vulnerability.\n\n### References\nhttps://www.tiny.cloud/docs/release-notes/release-notes571/#securityfixes\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in the [TinyMCE repo](https://github.com/tinymce/tinymce/issues)\n* Email us at [infosec@tiny.cloud](mailto:infosec@tiny.cloud)",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "tinymce"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.7.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tinymce/tinymce/security/advisories/GHSA-5vm8-hhgr-jcjp"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-27T21:29:43Z",
"nvd_published_at" : null
}
}