Cross-Site Scripting (XSS) in league/commonmark (CVE-2026-71478)
Summary
Cross-site scripting in league/commonmark (CVE-2026-71478). Risk of unauthorized operations or information disclosure. Exploitable via AttributesExtension. Mitigation: upgrade to 2.7.0 or later.
Original description
The description as published by the source.
Summary
The AttributesExtension's href/src unsafe-link filter (AttributesHelper::filterAttributes()) can be bypassed by embedding control bytes in a javascript: URL that browsers discard before parsing the scheme. Two variants:
- Tab/newline inside the scheme — a literal ASCII TAB (0x09), CR (0x0D), or LF (0x0A), e.g.
javascript:alert(1). Per the WHATWG URL Standard's "basic URL parser" step 3, browsers "remove all ASCII tab or newline from input". - Leading C0 controls — e.g.
<0x01>javascript:alert(1). Per step 1 of the same algorithm, browsers remove any leading or trailing C0 control or space. (A leading space alone does not bypass, becauseparseAttributes()alreadytrim()s the value; other C0 bytes are not trimmed.)
The filter is a literal anchored-prefix regex (RegexHelper::isLinkPotentiallyUnsafe() / REGEX_UNSAFE_PROTOCOL) that matches neither obfuscated form, so in both cases the browser still executes javascript:alert(1).
This is confirmed reproducible even with allow_unsafe_links => false set — i.e. even applications that have followed the library's own documented hardening guidance for untrusted input remain exploitable.
This is a sibling gap in the same defense that CVE-2025-46734 (GHSA-3527-qv2q-pfvx) fixed in v2.7.0 — that fix made href/src respect allow_unsafe_links, but did not normalize control bytes before checking, so these obfuscation techniques were never covered.
Vulnerability
Files:
- `src…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-71478 has been found in league/commonmark.
Attackers can target a specific entry point like AttributesExtension over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 6.1/10.
What to do: upgrade league/commonmark to 2.7.0 or later.
If unsure, ask your IT team or search "league/commonmark CVE-2026-71478" on the vendor's site.
CVE-2026-71478 (league/commonmark) — CWE-79 / CVSS v3 6.1
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: AttributesExtension / href / src / REGEX_UNSAFE_PROTOCOL
Patched: 2.7.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Cross-site scripting (XSS) (CWE-79) exists in league/commonmark. Attackers reach the vulnerable code path via AttributesExtension without authentication.
Check the vendor advisory for the affected versions of league/commonmark. Attack surface: AttributesExtension / href / src / REGEX_UNSAFE_PROTOCOL.
Severity: Medium (CVSS 6.1/10). Risk of unauthorized operations or information disclosure.
Update to 2.7.0.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'league/commonmark' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'league/commonmark' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
league/commonmarkを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade league/commonmark to 2.7.0ステージング環境で 2.7.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2026-71478 php-league-commonmark
- Ubuntu UBUNTU-CVE-2026-71478 markdown
References
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com