CVE-2025-46734
CVE-2025-46734 · league/commonmark Cross-site Scripting vulnerability in Attributes extension
This page contains facts from public vulnerability sources. Check the original advisory before updating.
league/commonmark is a PHP Markdown parser. A cross-site scripting (XSS) vulnerability in the Attributes extension of the league/commonmark library (versions 1.5.0 through 2.6.x) allows remote attackers to insert malicious JavaScript calls into HTML. The league/commonmark library provides configuration options such as `html_input: 'strip'` and `allow_unsafe_links: false` to mitigate cross-site scripting (XSS) attacks by stripping raw HTML and disallowing unsafe links. However, when the Attributes Extension is enabled, it introduces a way for users to inject arbitrary HTML attributes into elements via Markdown syntax using curly braces. Version 2.7.0 contains three changes to prevent this XSS attack vector: All attributes starting with `on` are considered unsafe and blocked by default; support for an explicit allowlist of allowed HTML attributes; and manually-added `href` and `src` attributes now respect the existing `allow_unsafe_links` configuration option. If upgrading is not feasible, please consider disabling the `AttributesExtension` for untrusted users and/or filtering the rendered HTML through a library like HTMLPurifier.
CVSS 6.4 · Medium · EPSS 0.4% · Fix available
- Published
- Updated
Affected products and versions
commonmark
- Versions
- < 2.7.0: Affected
No fix published
php-league-commonmark Debian:12
- Versions
- 2.3.9-1
- Affected ranges
- ECOSYSTEM: < 2.3.9-1+deb12u1
Update to 2.3.9-1+deb12u1
php-league-commonmark Debian:13
- Affected ranges
- ECOSYSTEM: < 2.7.0-1
Update to 2.7.0-1
php-league-commonmark Debian:14
- Affected ranges
- ECOSYSTEM: < 2.7.0-1
Update to 2.7.0-1
league/commonmark Packagist
- Versions
- 1.5.0
- 1.5.1
- 1.5.2
- 1.5.3
- 1.5.4
- 1.5.5
- 1.5.6
- 1.5.7
- 1.5.8
- 1.6.0
- 1.6.1
- 1.6.2
- 1.6.3
- 1.6.4
- 1.6.5
- 1.6.6
- 1.6.7
- 2.0.0
- 2.0.0-beta1
- 2.0.0-beta2
- 2.0.0-beta3
- 2.0.0-rc1
- 2.0.0-rc2
- 2.0.1
- 2.0.2
- 2.0.3
- 2.0.4
- 2.1.0
- 2.1.1
- 2.1.2
- 2.1.3
- 2.2.0
- 2.2.1
- 2.2.2
- 2.2.3
- 2.2.4
- 2.2.5
- 2.3.0
- 2.3.1
- 2.3.2
- 2.3.3
- 2.3.4
- 2.3.5
- 2.3.6
- 2.3.7
- 2.3.8
- 2.3.9
- 2.4.0
- 2.4.1
- 2.4.2
- 2.4.3
- 2.4.4
- 2.5.0
- 2.5.1
- 2.5.2
- 2.5.3
- 2.6.0
- 2.6.1
- 2.6.2
- Affected ranges
- ECOSYSTEM: ≥ 1.5.0, < 2.7.0
Update to 2.7.0
php-league-commonmark Ubuntu:Pro:20.04:LTS
- Versions
- 1.1.2-1
- 1.2.0-1
- 1.3.0-1
- 1.3.1-1
- 1.3.1-1ubuntu2
- Affected ranges
- ECOSYSTEM: < 1.3.1-1ubuntu2+esm1
Update to 1.3.1-1ubuntu2+esm1
php-league-commonmark Ubuntu:Pro:22.04:LTS
- Versions
- 1.5.7-2build1
- 1.6.6-1build1
- 1.6.7-1
- Affected ranges
- ECOSYSTEM: < 1.6.7-1ubuntu0.1~esm1
Update to 1.6.7-1ubuntu0.1~esm1
php-league-commonmark Ubuntu:Pro:24.04:LTS
- Versions
- 2.3.9-1
- 2.4.1-1
- 2.4.2-1
- 2.4.2-2
- Affected ranges
- ECOSYSTEM: < 2.4.2-2ubuntu0.1~esm1
Update to 2.4.2-2ubuntu0.1~esm1