Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-3v43-877x-qgmq

Опубликовано: 17 сент. 2019
Источник: github
Github: Прошло ревью
CVSS3: 6.1

Описание

Moderate severity vulnerability that affects league/commonmark

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:

[XSS](javascript:alert%28'XSS'%29)

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:

<p><a href="javascript&colon;alert('XSS')">XSS</a></p>

Browsers would interpret &colon; 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 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).

Credits

  • Mohit Fawaz for identifying the issue
  • Sebastiaan Knijnenburg and Ross Tuck for responsibly disclosing/relaying the issue
  • John MacFarlane for investigating it and implementing the upstream fix we mirrored here

References

Пакеты

Наименование

league/commonmark

composer
Затронутые версииВерсия исправления

< 0.18.3

0.18.3

EPSS

Процентиль: 55%
0.00326
Низкий

6.1 Medium

CVSS3

Дефекты

CWE-79

Связанные уязвимости

CVSS3: 6.1
nvd
почти 7 лет назад

Cross-site scripting (XSS) vulnerability in the PHP League CommonMark library before 0.18.3 allows remote attackers to insert unsafe links into HTML by using double-encoded HTML entities that are not properly escaped during rendering, a different vulnerability than CVE-2018-20583.

EPSS

Процентиль: 55%
0.00326
Низкий

6.1 Medium

CVSS3

Дефекты

CWE-79