CVE-2018-1000162
Description
Parsedown before 1.7.0 has a cross-site scripting vulnerability in setMarkupEscaped that allows specially crafted markdown to bypass HTML escaping and execute JavaScript.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Parsedown before 1.7.0 has a cross-site scripting vulnerability in setMarkupEscaped that allows specially crafted markdown to bypass HTML escaping and execute JavaScript.
Vulnerability
Parsedown versions prior to 1.7.0 contain a Cross-Site Scripting (XSS) vulnerability in the setMarkupEscaped method for escaping HTML. The flaw allows specially crafted markdown to sidestep HTML escaping by breaking AST boundaries, leading to injection of arbitrary JavaScript. The vulnerable versions are all Parsedown releases before 1.7.0 [1].
Exploitation
An attacker can exploit this vulnerability by supplying a specially crafted markdown input that manipulates the abstract syntax tree (AST) boundaries, causing the HTML escaping mechanism (setMarkupEscaped) to be bypassed. The attack requires no special privileges; it can be delivered via any vector where untrusted markdown is processed (e.g., user comments, forum posts). No authentication or special network position is needed if the markdown is rendered on a publicly accessible page [1][2].
Impact
Successful exploitation results in arbitrary JavaScript execution within the context of the victim's browser, leading to Cross-Site Scripting (XSS). This can be used to steal session cookies, deface web pages, redirect users, or perform other malicious actions on behalf of the victim. The attacker gains the ability to execute code with the same permissions as the legitimate user [1][2].
Mitigation
The vulnerability is fixed in Parsedown version 1.7.0 and later [1]. Users should upgrade to Parsedown 1.7.0 or newer. No workaround is mentioned in the references; the setSafeMode(true) method is not directly related, as setMarkupEscaped is described as `WARNING: This method is not safe from XSS!` [3]. Additional defense-in-depth measures such as Content Security Policy (CSP) and HTML sanitizers like HTML Purifier are recommended [3]. The CVE is not listed in CISA's Known Exploited Vulnerabilities (KEV) catalog as of this writing.
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 |
|---|---|---|
erusev/parsedownPackagist | < 1.7.0 | 1.7.0 |
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-qgpv-86r3-87fhghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2018-1000162ghsaADVISORY
- github.com/FriendsOfPHP/security-advisories/blob/master/erusev/parsedown/CVE-2018-1000162.yamlghsaWEB
- github.com/Roave/SecurityAdvisories/issues/44ghsax_refsource_MISCWEB
- github.com/erusev/parsedown/pull/495ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.