GHSA-W7JX-J77M-WP65
Vulnerability from github – Published: 2021-01-06 19:27 – Updated: 2024-01-03 22:31Impact
A cross-site scripting (XSS) vulnerability was discovered in the URL sanitization logic of the core parser. The vulnerability allowed arbitrary JavaScript execution when inserting a specially crafted piece of content into the editor using the clipboard or APIs. This impacts all users who are using TinyMCE 5.5.1 or lower.
Patches
This vulnerability has been patched in TinyMCE 5.6.0 by improved URL sanitization logic.
Workarounds
To work around this vulnerability, either:
- Upgrade to TinyMCE 5.6.0 or higher
- Manually sanitize iframe, object and embed URL attributes using a TinyMCE node filter.
- Disable iframe, object, and embed elements in your content using the invalid_elements setting.
Example: Sanitizing using a node filter
editor.parser.addNodeFilter('iframe,object,embed', function(nodes) {
nodes.forEach(function(node) {
if (node.attributes) {
node.attributes.forEach(function(attr) {
var name = attr.name;
var value = attr.value;
// Sanitize the attribute value here or remove it entirely
var sanitizedValue = ...;
node.attr(name, santizedValue);
});
}
});
});
Example: Using invalid_elements
invalid_elements: 'iframe,object,embed'
Acknowledgements
Tiny Technologies would like to thank Aaron Bishop at SecurityMetrics for discovering this vulnerability.
References
https://www.tiny.cloud/docs/release-notes/release-notes56/#securityfixes
For more information
If you have any questions or comments about this advisory: * Open an issue in the TinyMCE repo * Email us at infosec@tiny.cloud
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "tinymce"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.6.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "NuGet",
"name": "TinyMCE"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.6.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "tinymce/tinymce"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.6.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-21911"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2021-01-06T19:27:46Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Impact\nA cross-site scripting (XSS) vulnerability was discovered in the URL sanitization logic of the core parser. The vulnerability allowed arbitrary JavaScript execution when inserting a specially crafted piece of content into the editor using the clipboard or APIs. This impacts all users who are using TinyMCE 5.5.1 or lower.\n\n### Patches\nThis vulnerability has been patched in TinyMCE 5.6.0 by improved URL sanitization logic.\n\n### Workarounds\nTo work around this vulnerability, either:\n- Upgrade to TinyMCE 5.6.0 or higher\n- Manually sanitize `iframe`, `object` and `embed` URL attributes using a [TinyMCE node filter](https://www.tiny.cloud/docs/api/tinymce.html/tinymce.html.domparser/#addnodefilter).\n- Disable `iframe`, `object`, and `embed` 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(\u0027iframe,object,embed\u0027, 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: \u0027iframe,object,embed\u0027\n```\n\n### Acknowledgements\nTiny Technologies would like to thank Aaron Bishop at SecurityMetrics for discovering this vulnerability.\n\n### References\nhttps://www.tiny.cloud/docs/release-notes/release-notes56/#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)",
"id": "GHSA-w7jx-j77m-wp65",
"modified": "2024-01-03T22:31:57Z",
"published": "2021-01-06T19:27:54Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/tinymce/tinymce/security/advisories/GHSA-w7jx-j77m-wp65"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/package/tinymce"
},
{
"type": "WEB",
"url": "https://www.tiny.cloud/docs/release-notes/release-notes56/#securityfixes"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Cross-site scripting vulnerability in TinyMCE"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.