CVE-2019-10010: League/commonmark Moderate Severity Vulnerability That Affects Vulnerability
MODERATECVE-2019-10010 is a MODERATE (CVSS 6.1) moderate severity vulnerability that affects vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting League/commonmark libraries in the Packagist ecosystem. The issue involves moderate severity vulnerability that affects league/commonmark. Remediation is available by upgrading affected packages to version 0.18.3.
CVE-2019-10010 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2019-10010
To remediate this vulnerability, upgrade all affected League/commonmark dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade league/commonmark to 0.18.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for league/commonmark
How to Check if You Are Affected
To determine whether your application is affected by CVE-2019-10010, inspect your project dependencies for League/commonmark:
inspect dependencies for league/commonmark
Analyze the terminal output to locate any version of League/commonmark in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.18.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
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 League/commonmark, 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-2019-10010 Affected League/commonmark Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
league/commonmark
|
Packagist |
< 0.18.3
|
0.18.3
|
References
Frequently Asked Questions
What is CVE-2019-10010?
Which League/commonmark versions are affected?
What version fixes CVE-2019-10010?
Is league/commonmark affected?
What is the CVSS score of CVE-2019-10010?
What CWE is associated with CVE-2019-10010?
How can I check Packagist dependencies for CVE-2019-10010?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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<p><a href=\"javascript:alert('XSS')\">XSS</a></p>\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
}
}