CVE-2018-20583
Description
Cross-site scripting in PHP League CommonMark library versions before 0.18.1 allows injection of unsafe URLs via a newline character.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Cross-site scripting in PHP League CommonMark library versions before 0.18.1 allows injection of unsafe URLs via a newline character.
Vulnerability
The PHP League CommonMark library versions 0.15.6 through 0.18.0 (before 0.18.1) contain a cross-site scripting (XSS) vulnerability in the URL handling mechanism. Even when the allow_unsafe_links option is set to false, an attacker can bypass the filter by including a newline character in the URL (e.g., writing javascript as javascri%0apt). This allows unsafe URLs to be rendered in HTML output. [1][3]
Exploitation
An attacker with the ability to supply Markdown input to an application using the vulnerable library can craft a malicious link that contains a newline-encoded string. The attack does not require authentication or special privileges; it only requires the ability to submit content that will be rendered by the library. [1][2]
Impact
Successful exploitation leads to reflected or stored XSS, depending on how the rendered HTML is used. The attacker can execute arbitrary JavaScript in the context of the victim's browser, potentially leading to session hijacking, credential theft, or other malicious actions. [1][3]
Mitigation
The vulnerability is fixed in version 0.18.1 [4]. Users should upgrade to this version or later. If upgrading is not immediately possible, additional input sanitization and output encoding can be applied as a workaround. [1][3]
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
league/commonmarkPackagist | >= 0.15.6, < 0.18.1 | 0.18.1 |
Affected products
2- Range: 0.1.0, 0.1.1, 0.1.2, …
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
7- github.com/advisories/GHSA-qx76-c53f-5c7qghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2018-20583ghsaADVISORY
- commonmark.thephpleague.com/changelogghsaWEB
- commonmark.thephpleague.com/changelog/mitrex_refsource_MISC
- github.com/FriendsOfPHP/security-advisories/blob/master/league/commonmark/CVE-2018-20583.yamlghsaWEB
- github.com/thephpleague/commonmark/issues/337ghsax_refsource_MISCWEB
- github.com/thephpleague/commonmark/releases/tag/0.18.1ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.