Skip to content

CVE-2025-46734 league/commonmark Cross-site Scripting vulnerability in Attributes extension

MediumCVSS 6.4 EPSS 0.38%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: partial
Technology
PHPUbuntuDebian

Description

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.

Upgrade path

7 packages: 6 fixed.

PackageAffectedFixed inStatus
debian/php-league-commonmark(Debian 12) < 2.3.9-1+deb12u1; = 2.3.9-1 2.3.9-1+deb12u1 Fixed
debian/php-league-commonmark(Debian 13) < 2.7.0-1 2.7.0-1 Fixed
debian/php-league-commonmark(Debian 14) < 2.7.0-1 2.7.0-1 Fixed
league/commonmark(Packagist) = 1.5.0; = 1.5.1; = 1.5.2; = 1.5.3 +56 more 2.7.0 Fixed
ubuntu/php-league-commonmark(Ubuntu 22.04) < 1.6.7-1ubuntu0.1~esm1 1.6.7-1ubuntu0.1~esm1 Fixed
ubuntu/php-league-commonmark(Ubuntu 24.04) < 2.4.2-2ubuntu0.1~esm1 2.4.2-2ubuntu0.1~esm1 Fixed
thephpleague commonmark = < 2.7.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
league/commonmark(Packagist) >= 1.5.0, < 2.7.0 2.7.0
league/commonmark(Packagist) = 1.5.0 No fix listed
league/commonmark(Packagist) = 1.5.1 No fix listed
league/commonmark(Packagist) = 1.5.2 No fix listed
league/commonmark(Packagist) = 1.5.3 No fix listed
league/commonmark(Packagist) = 1.5.4 No fix listed
league/commonmark(Packagist) = 1.5.5 No fix listed
league/commonmark(Packagist) = 1.5.6 No fix listed
league/commonmark(Packagist) = 1.5.7 No fix listed
league/commonmark(Packagist) = 1.5.8 No fix listed
league/commonmark(Packagist) = 1.6.0 No fix listed
league/commonmark(Packagist) = 1.6.1 No fix listed
league/commonmark(Packagist) = 1.6.2 No fix listed
league/commonmark(Packagist) = 1.6.3 No fix listed
league/commonmark(Packagist) = 1.6.4 No fix listed
league/commonmark(Packagist) = 1.6.5 No fix listed
league/commonmark(Packagist) = 1.6.6 No fix listed
league/commonmark(Packagist) = 1.6.7 No fix listed
league/commonmark(Packagist) = 2.0.0 No fix listed
league/commonmark(Packagist) = 2.0.0-beta1 No fix listed
league/commonmark(Packagist) = 2.0.0-beta2 No fix listed
league/commonmark(Packagist) = 2.0.0-beta3 No fix listed
league/commonmark(Packagist) = 2.0.0-rc1 No fix listed
league/commonmark(Packagist) = 2.0.0-rc2 No fix listed
league/commonmark(Packagist) = 2.0.1 No fix listed
Show 42 more
ProductAffected versionsFixed in
league/commonmark(Packagist) = 2.0.2 No fix listed
league/commonmark(Packagist) = 2.0.3 No fix listed
league/commonmark(Packagist) = 2.0.4 No fix listed
league/commonmark(Packagist) = 2.1.0 No fix listed
league/commonmark(Packagist) = 2.1.1 No fix listed
league/commonmark(Packagist) = 2.1.2 No fix listed
league/commonmark(Packagist) = 2.1.3 No fix listed
league/commonmark(Packagist) = 2.2.0 No fix listed
league/commonmark(Packagist) = 2.2.1 No fix listed
league/commonmark(Packagist) = 2.2.2 No fix listed
league/commonmark(Packagist) = 2.2.3 No fix listed
league/commonmark(Packagist) = 2.2.4 No fix listed
league/commonmark(Packagist) = 2.2.5 No fix listed
league/commonmark(Packagist) = 2.3.0 No fix listed
league/commonmark(Packagist) = 2.3.1 No fix listed
league/commonmark(Packagist) = 2.3.2 No fix listed
league/commonmark(Packagist) = 2.3.3 No fix listed
league/commonmark(Packagist) = 2.3.4 No fix listed
league/commonmark(Packagist) = 2.3.5 No fix listed
league/commonmark(Packagist) = 2.3.6 No fix listed
league/commonmark(Packagist) = 2.3.7 No fix listed
league/commonmark(Packagist) = 2.3.8 No fix listed
league/commonmark(Packagist) = 2.3.9 No fix listed
league/commonmark(Packagist) = 2.4.0 No fix listed
league/commonmark(Packagist) = 2.4.1 No fix listed
league/commonmark(Packagist) = 2.4.2 No fix listed
league/commonmark(Packagist) = 2.4.3 No fix listed
league/commonmark(Packagist) = 2.4.4 No fix listed
league/commonmark(Packagist) = 2.5.0 No fix listed
league/commonmark(Packagist) = 2.5.1 No fix listed
league/commonmark(Packagist) = 2.5.2 No fix listed
league/commonmark(Packagist) = 2.5.3 No fix listed
league/commonmark(Packagist) = 2.6.0 No fix listed
league/commonmark(Packagist) = 2.6.1 No fix listed
league/commonmark(Packagist) = 2.6.2 No fix listed
debian/php-league-commonmark(Debian:12) < 2.3.9-1+deb12u1 2.3.9-1+deb12u1
debian/php-league-commonmark(Debian:14) < 2.7.0-1 2.7.0-1
debian/php-league-commonmark(Debian:13) < 2.7.0-1 2.7.0-1
debian/php-league-commonmark(Debian:12) = 2.3.9-1 No fix listed
thephpleague commonmark = < 2.7.0 No fix listed
ubuntu/php-league-commonmark(Ubuntu:22.04) < 1.6.7-1ubuntu0.1~esm1 1.6.7-1ubuntu0.1~esm1
ubuntu/php-league-commonmark(Ubuntu:24.04) < 2.4.2-2ubuntu0.1~esm1 2.4.2-2ubuntu0.1~esm1

References