Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-33347: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in thephpleague commonmark

0
Medium
VulnerabilityCVE-2026-33347cvecve-2026-33347cwe-79cwe-185cwe-918
Published: Tue Mar 24 2026 (03/24/2026, 19:26:23 UTC)
Source: CVE Database V5
Vendor/Project: thephpleague
Product: commonmark

Description

CVE-2026-33347 is a medium severity cross-site scripting (XSS) vulnerability in thephpleague's commonmark PHP Markdown parser versions 2. 3. 0 through 2. 8. 1. The flaw exists in the DomainFilteringAdapter of the Embed extension, where a missing hostname boundary assertion in the domain-matching regex allows an attacker to bypass the allowlist. This enables malicious domains like youtube. com. evil to be treated as allowed domains such as youtube. com, potentially leading to XSS attacks.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 03/24/2026, 20:01:48 UTC

Technical Analysis

CVE-2026-33347 is a cross-site scripting vulnerability identified in thephpleague's commonmark PHP Markdown parser, specifically within the DomainFilteringAdapter component of the Embed extension. The vulnerability arises from an improper regular expression used for domain allowlist validation, which lacks a hostname boundary assertion. This flaw allows attacker-controlled domains that append additional subdomains or suffixes (e.g., youtube.com.evil) to bypass the allowlist check intended to restrict embedding to trusted domains like youtube.com. When the vulnerable versions (>= 2.3.0 and < 2.8.2) process Markdown content containing embedded URLs, the DomainFilteringAdapter fails to correctly validate the domain, enabling malicious content injection. This can lead to reflected or stored XSS attacks, where an attacker can execute arbitrary JavaScript in the context of the victim's browser, potentially stealing session tokens, performing actions on behalf of the user, or delivering further payloads. The vulnerability does not require authentication or user interaction, increasing its risk profile. The issue was addressed in version 2.8.2 by correcting the regex to properly assert domain boundaries, preventing allowlist bypass. No known exploits have been reported in the wild as of the publication date. The CVSS 4.0 base score is 6.3 (medium severity), reflecting network attack vector, low attack complexity, no privileges required, no user interaction, and limited impact on confidentiality and integrity.

Potential Impact

The primary impact of CVE-2026-33347 is the potential for cross-site scripting attacks in web applications that use thephpleague commonmark library with the Embed extension enabled and rely on domain allowlisting for security. Successful exploitation can lead to unauthorized script execution in users' browsers, resulting in session hijacking, credential theft, defacement, or further malware delivery. This can damage organizational reputation, lead to data breaches, and cause regulatory compliance issues. Since the vulnerability can be exploited remotely without authentication or user interaction, it poses a significant risk to any public-facing web service using affected versions. The scope is limited to applications that embed external content via the vulnerable component, but given the popularity of PHP and Markdown parsers in content management systems, blogs, and developer tools, the affected attack surface is broad. The absence of known exploits in the wild reduces immediate risk but does not eliminate the threat, especially as attackers may develop exploits following disclosure.

Mitigation Recommendations

Organizations should immediately upgrade thephpleague commonmark library to version 2.8.2 or later, where the vulnerability is patched. For environments where immediate upgrade is not feasible, applying custom patches to fix the domain-matching regex by adding proper hostname boundary assertions can mitigate the risk. Additionally, implement defense-in-depth by sanitizing and validating all user-generated content before processing with Markdown parsers. Employ Content Security Policy (CSP) headers to restrict script execution and reduce the impact of potential XSS. Monitor logs for unusual embedding attempts or suspicious domain patterns that resemble allowlist bypass attempts. Conduct regular security code reviews and dependency audits to detect similar issues proactively. Finally, educate developers on secure regex construction and the risks of improper input validation in web content generation.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-03-18T22:15:11.814Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 69c2ea08f4197a8e3b6b643c

Added to database: 3/24/2026, 7:46:16 PM

Last enriched: 3/24/2026, 8:01:48 PM

Last updated: 3/24/2026, 8:54:07 PM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses