{"id":"GHSA-hh8v-hgvp-g3f5","aliases":["CVE-2026-33347"],"title":"league/commonmark has an embed extension allowed_domains bypass","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"### 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":"medium","score":6.3,"published":"2026-03-19T19:04:24.000Z","modified":"2026-03-27T22:16:23.526Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Packagist","name":"league/commonmark","sources":[{"name":"OSV · GHSA-hh8v-hgvp-g3f5","url":"https://osv.dev/vulnerability/GHSA-hh8v-hgvp-g3f5"}],"ranges":[{"events":[{"introduced":"2.3.0"},{"fixed":"2.8.2"}],"type":"ECOSYSTEM"}],"versions":["2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.3.9","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.5.0","2.5.1","2.5.2","2.5.3","2.6.0","2.6.1","2.6.2","2.7.0","2.7.1","2.8.0","2.8.1"],"fixed":["2.8.2"]}],"sourceAffected":[],"references":["https://github.com/thephpleague/commonmark/security/advisories/GHSA-hh8v-hgvp-g3f5","https://nvd.nist.gov/vuln/detail/CVE-2026-33347","https://github.com/thephpleague/commonmark/commit/59fb075d2101740c337c7216e3f32b36c204218b","https://github.com/thephpleague/commonmark","https://github.com/thephpleague/commonmark/releases/tag/2.8.2"],"sources":[{"name":"OSV","id":"GHSA-hh8v-hgvp-g3f5","modified":"2026-03-27T22:16:23.526812Z","url":"https://osv.dev/vulnerability/GHSA-hh8v-hgvp-g3f5"}],"assessments":[{"source":"OSV","vector":"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","score":6.3}],"products":[],"remediation":[],"kev":{"status":"not-listed","checkedAt":"2026-10-28T18:20:33.032Z"},"coverage":[{"source":"NVD","status":"not-checked"},{"source":"GHSA","status":"not-checked"},{"source":"EUVD","status":"not-checked"},{"source":"EPSS","status":"not-checked"}],"evidence":[]}