CVE-2026-33347: League/commonmark League/commonmark Has An Embed Extension Vulnerability

MODERATE
Advisory Identifier: GHSA-hh8v-hgvp-g3f5
CWE-185 CWE-79 CWE-918
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-33347
GHSA Identifier GHSA-hh8v-hgvp-g3f5
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-185: Incorrect Regular Expression
Affected Product League/commonmark
Package Ecosystem Packagist
Published Date
Last Updated

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.

league/commonmark fixed: 2.8.2
Upgrade league/commonmark to 2.8.2
Verify Direct and Transitive Dependencies

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

### Impact The `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. This enables two attack vectors: - **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. - **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. Any application using the `Embed` extension and relying on `allowed_domains` to restrict domains when processing untrusted Markdown input is affected. ### Patches This 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. ### Workarounds - Disable the `Embed` extension, or restrict its use to trusted users - Provide your own domain-filtering implementation of `EmbedAdapterInterface` - Enable a [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) and outbound firewall restrictions

CVE-2026-33347 Affected League/commonmark Versions

1 component(s)
Fixed Versions:
2.8.2
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?
CVE-2026-33347 is a security vulnerability in League/commonmark involving league/commonmark has an embed extension allowed_domains bypass under CWE-185: Incorrect Regular Expression.
Which League/commonmark versions are affected?
Affected versions include releases prior to 2.8.2 across affected packages: league/commonmark.
What version fixes CVE-2026-33347?
Upgrading to 2.8.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is league/commonmark affected?
Yes, league/commonmark is affected in releases prior to 2.8.2. Upgrade your dependency to 2.8.2 or later.
What CWE is associated with CVE-2026-33347?
CVE-2026-33347 is classified under CWE-185: Incorrect Regular Expression (The product specifies a regular expression in a way that causes data to be improperly matched or compared.).
How can I check Packagist dependencies for CVE-2026-33347?
Run the dependency tree command: 'inspect dependencies for league/commonmark'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}