Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐘 Packagist

GHSA-3v43-877x-qgmq

MEDIUM

GHSA-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

Also known asCVE-2019-10010
Published
Sep 17, 2019
Updated
Feb 16, 2024
Affected
1 pkg
Patched
1 / 1
Exploits
1 known

Blast Radius

1 pkg affected
🐘league/commonmark

Real-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&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

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐘Packagistleague/commonmarkall versions0.18.3
Exploits & PoCs
1

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 dependency
  1. Detect

    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.

  2. 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.

  3. 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.

  4. 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

## 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: ```md [XSS](javascript&amp;colon;alert%28&#039;XSS&#039;%29) ``` This library would (correctly) unescape the `&amp;` entity to `&` during the parsing step. However, **the renderer step would fail to properly re-escape the resulting `&colon;` string**, thus producing the following malicious HTML output: ```html <p><a href="javascript&colon;alert('XSS')">XSS</a></p> ``` Browsers would interpret `&colon;` as a `:` character and allow t
O3 Security · Impact-Aware SCA

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.