Moderate severity vulnerability that affects league/commonmark
Moderate severity
GitHub Reviewed
Published
Aug 26, 2019
in
thephpleague/commonmark
•
Updated Feb 6, 2024
Description
Published to the GitHub Advisory Database
Sep 17, 2019
Reviewed
Jun 16, 2020
Last updated
Feb 6, 2024
CVE-2019-10010
Impact
In
league/commonmark
0.18.2 and below, malicious users can insert double-encoded HTML entities into their Markdown like this:This 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:Browsers would interpret
:
as a:
character and allow the JS to be executed when the link is clicked.This vulnerability was present in the upstream library this project was forked from and therefore exists in all prior versions of
league/commonmark
.Solution
The new 0.18.3 release mirrors the fix made upstream - we no longer attempt to preserve entities when rendering HTML attributes like
href
,src
,title
, etc.The
$preserveEntities
parameter ofXml::escape()
is therefore no longer used internally, so it has been deprecated and marked for removal in the next major release (0.19.0).Credits
References
References