CVE-2026-33347: League/commonmark League/commonmark Has An Embed Extension Vulnerability
MODERATECVE-2026-33347 is a MODERATE league/commonmark has an embed extension vulnerability (CWE-185: Incorrect Regular Expression) affecting League/commonmark libraries in the Packagist ecosystem. The issue involves league/commonmark has an embed extension allowed_domains bypass. Remediation is available by upgrading affected packages to version 2.8.2.
CVE-2026-33347 at a Glance
How to Fix CVE-2026-33347
To remediate this vulnerability, upgrade all affected League/commonmark dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade league/commonmark to 2.8.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for league/commonmark
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-33347, inspect your project dependencies for League/commonmark:
inspect dependencies for league/commonmark
Analyze the terminal output to locate any version of League/commonmark in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-185: Incorrect Regular Expression, where the product specifies a regular expression in a way that causes data to be improperly matched or compared. In League/commonmark, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-33347 Affected League/commonmark Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
league/commonmark
|
Packagist |
≥ 2.3.0
< 2.8.2
|
2.8.2
|
References
Frequently Asked Questions
What is CVE-2026-33347?
Which League/commonmark versions are affected?
What version fixes CVE-2026-33347?
Is league/commonmark affected?
What CWE is associated with CVE-2026-33347?
How can I check Packagist dependencies for CVE-2026-33347?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hh8v-hgvp-g3f5",
"modified" : "2026-03-27T21:58:03Z",
"published" : "2026-03-19T19:04:24Z",
"aliases" : [ "CVE-2026-33347" ],
"summary" : "league/commonmark has an embed extension allowed_domains bypass",
"details" : "### Impact\n\nThe `DomainFilteringAdapter` in the Embed extension is vulnerable to an allowlist bypass due to a missing hostname boundary assertion in the domain-matching regex. An attacker-controlled domain like `youtube.com.evil` passes the allowlist check when `youtube.com` is an allowed domain.\n\nThis enables two attack vectors:\n\n- **SSRF**: The `OscaroteroEmbedAdapter` makes server-side HTTP requests to the embed URL via the `embed/embed` library. A bypassed domain filter causes the server to make outbound requests to an attacker-controlled host, potentially probing internal services or exfiltrating request metadata.\n- **XSS**: `EmbedRenderer` outputs the oEmbed response HTML directly into the page with no sanitization. An attacker controlling the bypassed domain can return arbitrary HTML/JavaScript in their oEmbed response, which is rendered verbatim.\n\nAny application using the `Embed` extension and relying on `allowed_domains` to restrict domains when processing untrusted Markdown input is affected.\n\n### Patches\n\nThis has been patched in version **2.8.2**. The fix replaces the regex-based domain check with explicit hostname parsing using `parse_url()`, ensuring exact domain and subdomain matching only.\n\n### Workarounds\n\n- Disable the `Embed` extension, or restrict its use to trusted users\n- Provide your own domain-filtering implementation of `EmbedAdapterInterface`\n- Enable a [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) and outbound firewall restrictions",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "league/commonmark"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.3.0"
}, {
"fixed" : "2.8.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.8.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/thephpleague/commonmark/security/advisories/GHSA-hh8v-hgvp-g3f5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33347"
}, {
"type" : "WEB",
"url" : "https://github.com/thephpleague/commonmark/commit/59fb075d2101740c337c7216e3f32b36c204218b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/thephpleague/commonmark"
}, {
"type" : "WEB",
"url" : "https://github.com/thephpleague/commonmark/releases/tag/2.8.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-185", "CWE-79", "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-19T19:04:24Z",
"nvd_published_at" : "2026-03-24T20:16:29Z"
}
}