{"id":"CVE-2025-46734","published":"2025-05-05T19:52:59Z","modified":"2025-05-06T13:47:03Z","title":"league/commonmark Cross-site Scripting vulnerability in Attributes extension","vendor":"thephpleague","product":"commonmark","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00384,"percentile":0.33371,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/thephpleague/commonmark/security/advisories/GHSA-3527-qv2q-pfvx","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/thephpleague/commonmark/commit/f0d626cf05ad3e99e6db26ebcb9091b6cd1cd89b","tags":["x_refsource_MISC"]}],"priority":{"score":11.2,"factors":[{"name":"EPSS percentile","points":6.67},{"name":"CVSS severity","points":4.48}]},"vendorSlug":"thephpleague","affectedVersions":[{"vendor":"thephpleague","product":"commonmark","versions":["< 2.7.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-05-06T13:46:48.899340Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"league/commonmark","vulnerableRanges":[">=1.5.0, <2.7.0"],"patched":["2.7.0"],"from":["GHSA-3527-qv2q-pfvx"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-13411","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2018-20583","published":"2018-12-30","fixed":"0.18.1","kev":false},{"cve":"CVE-2019-10010","published":"2019-03-24","fixed":"0.18.3","kev":false},{"cve":"CVE-2025-46734","published":"2025-05-05","fixed":"2.7.0","kev":false},{"cve":"CVE-2026-30838","published":"2026-03-07","fixed":"2.8.1","kev":false,"link":{"from":"CVE-2025-46734","to":"CVE-2026-30838","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:league/commonmark","fromFixed":"2.7.0","toFixed":"2.8.1","daysApart":306}]}},{"cve":"CVE-2026-33347","published":"2026-03-24","fixed":"2.8.2","kev":false},{"cve":"CVE-2026-71478","published":"2026-08-06","fixed":"2.9.0","kev":false}],"package":"Packagist:league/commonmark"}}