CVE-2026-71478 league/commonmark: AttributesExtension href/src unsafe-link filter bypass via embedded control bytes

Medium 6.1 Published Updated

Attackers can bypass unsafe-link filters in league/commonmark to inject JavaScript via control bytes, leading to XSS in rendered Markdown.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-71478?

CVE-2026-71478 is a medium-severity cross-site scripting vulnerability in thephpleague commonmark, published on 6 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

league/commonmark is a PHP library for parsing and rendering CommonMark Markdown. From 1.5.0 until 2.9.0, the AttributesExtension's href and src unsafe-link filter can be bypassed by embedding control bytes, such as a tab, carriage return, line feed, or leading C0 control character, in a javascript: URL that browsers discard before parsing the scheme, causing the browser to still execute the script even when the unsafe-link filter is enabled. This issue is fixed in 2.9.0.

Weakness: CWE-86, CWE-79, CWE-692

Which versions are affected by CVE-2026-71478?

2 open source packages ship an affected version, including league/commonmark.

PackageAffectedFixed in
league/commonmark PackagistFrom 1.5.02.9.0
league/commonmark PackagistFrom 1.5.02.9.0

How do I fix CVE-2026-71478?

Upgrade league/commonmark to 2.9.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-71478 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-71478 exists.

Sources

Also known as DEBIAN-CVE-2026-71478, GHSA-29pj-957v-52mc, UBUNTU-CVE-2026-71478.

Is CVE-2026-71478 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free