GHSA-3v43-877x-qgmq
MEDIUMGHSA-3v43-877x-qgmq is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in league/commonmark. 1 public exploit reference exists, so weaponization risk is real. O3 Security confirms whether GHSA-3v43-877x-qgmq is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Moderate severity vulnerability that affects league/commonmark
Blast Radius
league/commonmarkReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
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:alert('XSS')">XSS</a></p>
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 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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | league/commonmark | all versions | 0.18.3 |
Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for league/commonmark. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update league/commonmark to 0.18.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3v43-877x-qgmq is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-3v43-877x-qgmq is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-3v43-877x-qgmq. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-3v43-877x-qgmq in your dependencies?
O3 detects GHSA-3v43-877x-qgmq across Packagist dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.