Medium · 6.5 PHP packages GHSA-m9xh-6747-9r6f CVE-2026-107381 PKSA-6j95-1jtb-x6wc GHSA-v383-3rw5-q8rf
Two Denial-of-Service Flaws Patched in enshrined/svg-sanitize PHP Library
The PHP library enshrined/svg-sanitize, used to sanitize untrusted SVG/XML content, contained two separate denial-of-service weaknesses that allowed attackers to bypass nesting protections or crash PHP workers. Both are fixed in version 1.0.0.
By PatchBriefing ·
Produced automatically from official sources with the help of AI. How we work →
- OSV.dev database 1mo ago · view ↗
- OSV.dev database 1mo ago · view ↗
- Packagist Security Advisories registry 1mo ago · view ↗
- Packagist Security Advisories registry 1mo ago · view ↗
- GitHub Advisory Database database 1mo ago · view ↗
- GitHub Advisory Database database 1mo ago · view ↗
- NVD (NIST) database 1mo ago · view ↗
- NVD (NIST) database 1mo ago · view ↗
AI summary
Two related denial-of-service vulnerabilities have been disclosed in enshrined/svg-sanitize, a PHP library used to sanitize SVG and XML content before it is rendered or stored by an application. Both issues affect versions up through 0.22.0 and are resolved in version 1.0.0. Neither vulnerability is currently known to be exploited in the wild, and no public exploit code has been reported.
What happened
Two distinct denial-of-service issues were identified in enshrined/svg-sanitize. The first, CVE-2026-107381, involves a case-sensitivity flaw in the reference resolver that builds the graph of nested <use> elements inside an SVG. The second, CVE-2026-107379, involves improper handling of a crafted SVG DTD (Document Type Definition) attribute default that triggers a duplicate attribute removal inside the sanitizer's attribute-cleaning logic. Both issues allow an attacker who can submit SVG content to an application using this library to cause excessive resource consumption or worker crashes.
Technical cause
CVE-2026-107381: Resolver::processReferences() in src/ElementReference/Resolver.php builds the SVG <use> reference graph using a case-sensitive match on the href attribute before cleanHrefAttributes() normalizes mixed-case attribute names. By using a nested <use> element with the attribute written as xlink:HrEf instead of xlink:href, an attacker can cause the resolver to omit that reference from its graph. The sanitizer later converts the attribute to the canonical xlink:href form and returns the live nesting structure without the useNestingLimit protection being applied, since that reference was never tracked. An application that renders the resulting sanitized SVG can be exposed to the resource exhaustion this limit was designed to prevent. CVE-2026-107379: A crafted SVG DTD can declare a #FIXED attribute default that causes cleanAttributesOnWhitelist() in src/Sanitizer.php to call DOMElement::removeAttribute() twice on the same attribute name. The first call removes the explicitly set attribute, after which the DTD default rematerializes the value before the href safety path performs a second removal. This sequence can corrupt internal libxml state and terminate the PHP worker process handling the request.
Why it matters
Applications typically use svg-sanitize specifically to make untrusted, user-supplied SVG files safe to render. Both of these flaws undermine protections that are meant to prevent denial-of-service conditions from maliciously crafted SVG input. CVE-2026-107381 defeats the library's own nesting-depth safeguard, potentially allowing SVG-based resource exhaustion when the sanitized output is rendered. CVE-2026-107379 can directly crash the PHP worker processing the sanitization request, which, if repeated, can degrade or exhaust application availability.
Who is affected
Any application or service that uses the enshrined/svg-sanitize Composer package to sanitize SVG or XML content submitted by users, particularly if that content is later rendered, is affected if running an impacted version.
Affected versions
Versions of enshrined/svg-sanitize up to and including 0.22.0 are affected by both CVE-2026-107381 and CVE-2026-107379. Both issues are fixed in version 1.0.0.
Fixes and mitigation
The vendor has released version 1.0.0 of enshrined/svg-sanitize, which fixes both CVE-2026-107381 and CVE-2026-107379. No partial mitigations or workarounds are described in the available advisories.
Recommended action
Update enshrined/svg-sanitize to version 1.0.0 as soon as practical. Since 1.0.0 is a major version bump from the 0.x series, review the library's changelog and your integration code for breaking changes before deploying to production. Prioritize this update for any service that accepts SVG uploads or SVG content from untrusted sources.
PatchBriefing score
6.5 / 10 · Medium
Official CVSS: 6.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
EPSS 0.0045 (31 percentile)
Why this score
The PatchBriefing score equals the official CVSS score; when this article covers several vulnerabilities, the highest one. Signals such as known exploitation and EPSS are listed separately and do not change the score.
Affected versions
- enshrined/svg-sanitize ≥ 0 < 1.0.0
- vulnerable
- enshrined/svg-sanitize
- vulnerable
- enshrined/svg-sanitize <=0.22.0
- vulnerable
- enshrined/svg-sanitize <= 0.22.0
- vulnerable
- ≥ 1.0.0
- patched
- enshrined/svg-sanitize ≥ 0 < 1.0.0
- vulnerable
- enshrined/svg-sanitize
- vulnerable
- enshrined/svg-sanitize <=0.22.0
- vulnerable
- enshrined/svg-sanitize <= 0.22.0
- vulnerable
- ≥ 1.0.0
- patched
Reported fixes
The vendor has released version 1.0.0 of enshrined/svg-sanitize, which fixes both CVE-2026-107381 and CVE-2026-107379. No partial mitigations or workarounds are described in the available advisories.
How this was built
8 source records were collected, matched and used to prepare the report above.
-
OSV.dev database
-
OSV.dev database
-
Packagist Security Advisories registry
-
Packagist Security Advisories registry
-
GitHub Advisory Database database
-
GitHub Advisory Database database
Revision history
- Generated
- Published
- Generated