{ "schema_version": "1.4.0", "id": "GHSA-3v43-877x-qgmq", "modified": "2021-08-31T21:29:59Z", "published": "2019-09-17T22:47:47Z", "aliases": [ "CVE-2019-10010" ], "summary": "Moderate severity vulnerability that affects league/commonmark", "details": "## CVE-2019-10010\n\n### Impact\n\nIn `league/commonmark` 0.18.2 and below, malicious users can insert double-encoded HTML entities into their Markdown like this:\n\n```md\n[XSS](javascript&colon;alert%28'XSS'%29)\n```\n\nThis library would (correctly) unescape the `&` entity to `&` during the parsing step. However, **the renderer step would fail to properly re-escape the resulting `:` string**, thus producing the following malicious HTML output:\n\n```html\n

XSS

\n```\n\nBrowsers would interpret `:` as a `:` character and allow the JS to be executed when the link is clicked.\n\nThis vulnerability was present in the upstream library this project was forked from and therefore exists in all prior versions of `league/commonmark`.\n\n### Solution\n\nThe new [0.18.3](https://github.com/thephpleague/commonmark/releases/tag/0.18.3) release mirrors [the fix made upstream](https://github.com/commonmark/commonmark.js/commit/c89b35c5fc99bdf1d2181f7f0c9fcb8a1abc27c8) - we no longer attempt to preserve entities when rendering HTML attributes like `href`, `src`, `title`, etc.\n\nThe `$preserveEntities` parameter of `Xml::escape()` is therefore no longer used internally, so it has been deprecated and marked for removal in the next major release (0.19.0).\n\n### Credits\n\n - Mohit Fawaz for identifying the issue\n - Sebastiaan Knijnenburg and Ross Tuck for responsibly disclosing/relaying the issue\n - John MacFarlane for investigating it and implementing the upstream fix we mirrored here\n\n### References\n\n - https://nvd.nist.gov/vuln/detail/CVE-2019-10010\n - https://github.com/thephpleague/commonmark/releases/tag/0.18.3\n - https://github.com/thephpleague/commonmark/issues/353\n- https://github.com/FriendsOfPHP/security-advisories/blob/master/league/commonmark/CVE-2019-10010.yaml", "severity": [ { "type": "CVSS_V3", "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N" } ], "affected": [ { "package": { "ecosystem": "Packagist", "name": "league/commonmark" }, "ranges": [ { "type": "ECOSYSTEM", "events": [ { "introduced": "0" }, { "fixed": "0.18.3" } ] } ] } ], "references": [ { "type": "WEB", "url": "https://github.com/thephpleague/commonmark/security/advisories/GHSA-3v43-877x-qgmq" }, { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-10010" }, { "type": "WEB", "url": "https://github.com/thephpleague/commonmark/issues/353" }, { "type": "WEB", "url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/league/commonmark/CVE-2019-10010.yaml" }, { "type": "ADVISORY", "url": "https://github.com/advisories/GHSA-3v43-877x-qgmq" }, { "type": "WEB", "url": "https://github.com/thephpleague/commonmark" }, { "type": "WEB", "url": "https://github.com/thephpleague/commonmark/releases/tag/0.18.3" } ], "database_specific": { "cwe_ids": [ "CWE-79" ], "severity": "MODERATE", "github_reviewed": true, "github_reviewed_at": "2020-06-16T20:56:22Z", "nvd_published_at": null } }