CVE-2018-20583 PHP League CommonMark vulnerable to Cross-Site Scripting (XSS)

Medium 6.1 Published Updated

Remote attackers can inject unsafe URLs via newline characters in the PHP League CommonMark library, bypassing link safety checks.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2018-20583?

CVE-2018-20583 is a medium-severity cross-site scripting vulnerability in n/a, published on 30 Dec 2018. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Cross-site scripting (XSS) vulnerability in the PHP League CommonMark library versions 0.15.6 through 0.18.x before 0.18.1 allows remote attackers to insert unsafe URLs into HTML (even if allow_unsafe_links is false) via a newline character (e.g., writing javascript as javascri%0apt).

Weakness: CWE-79

Which versions are affected by CVE-2018-20583?

2 open source packages ship an affected version, including league/commonmark. It affects 1 product.

PackageAffectedFixed in
league/commonmark PackagistFrom 0.15.60.18.1
league/commonmark PackagistFrom 0.15.60.18.1

Products include Thephpleague Commonmark.

How do I fix CVE-2018-20583?

Upgrade league/commonmark to 0.18.1 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2018-20583 being exploited?

There is no known exploitation of CVE-2018-20583 in the wild and no public exploit code.

Sources

Also known as GHSA-qx76-c53f-5c7q.

Is CVE-2018-20583 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free