Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-107379 Overview
CVE-2026-107379 is a denial-of-service vulnerability in svg-sanitizer, a PHP library used to sanitize SVG and XML content. Versions prior to 1.0.0 mishandle SVG Document Type Definition (DTD) attribute defaults inside the cleanAttributesOnWhitelist() function in src/Sanitizer.php. A crafted SVG containing a #FIXED DTD attribute default causes a double DOMElement::removeAttribute() call on the same attribute. The resulting libxml state corruption terminates the PHP worker processing the request. An authenticated attacker able to submit SVG content to a sanitization endpoint can repeatedly crash workers and exhaust application availability. The issue is fixed in version 1.0.0.
Critical Impact
Repeated submission of crafted SVG payloads terminates PHP workers, degrading or exhausting availability of any application that routes user-supplied SVGs through svg-sanitizer.
Affected Products
- svg-sanitizer (darylldoyle/svg-sanitizer) versions prior to 1.0.0
- PHP applications embedding svg-sanitizer for SVG/XML cleaning
- Content management systems and web platforms using svg-sanitizer to process user-uploaded SVGs
Discovery Timeline
- 2026-10-08 - CVE-2026-107379 published to the National Vulnerability Database (NVD)
- 2026-10-09 - Last updated in NVD database
Technical Details for CVE-2026-107379
Vulnerability Analysis
The flaw sits in the attribute cleaning path of svg-sanitizer. When cleanAttributesOnWhitelist() processes an SVG element, it may call DOMElement::removeAttribute() more than once against the same attribute name. If an attached DTD declares that attribute with a #FIXED default value, PHP's libxml layer rematerializes the attribute between removals. The second removal then operates on an attribute that was reinstated by the DTD rather than present through normal parsing. This desynchronization corrupts libxml internal state and crashes the PHP worker handling the request.
The vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, reflecting that unlimited crash-inducing requests exhaust worker capacity. Confidentiality and integrity are not impacted; the issue is strictly an availability concern.
Root Cause
The root cause is a logic defect in cleanAttributesOnWhitelist() within src/Sanitizer.php. The function removes a flagged attribute explicitly and then re-enters the href safety path, which removes the same attribute a second time. Under a DTD declaring that attribute as #FIXED, libxml automatically re-adds the default value between the two removals, leaving the DOM in a state the sanitizer does not expect.
Attack Vector
An attacker with low-privileged network access submits an SVG document that references a DTD defining a #FIXED default for an attribute the sanitizer will attempt to remove. Processing the payload triggers the double removal and terminates the worker. Repeated submission against any endpoint that passes untrusted SVG through svg-sanitizer produces sustained worker churn and service degradation.
No verified public exploit code is available. Refer to the GitHub Security Advisory GHSA-v383-3rw5-q8rf for additional technical context.
Detection Methods for CVE-2026-107379
Indicators of Compromise
- Unexpected termination or segmentation faults of PHP-FPM or PHP CLI workers coinciding with SVG upload activity.
- SVG uploads containing inline <!DOCTYPE> declarations with <!ATTLIST ... #FIXED ...> definitions.
- Elevated 5xx response rates on endpoints that invoke svg-sanitizer sanitization routines.
Detection Strategies
- Inventory PHP projects for darylldoyle/svg-sanitizer via composer.lock and flag any installed version below 1.0.0.
- Inspect uploaded SVG samples for embedded DTDs, ENTITY declarations, and ATTLIST entries with #FIXED defaults before they reach the sanitizer.
- Correlate web server access logs for repeated SVG POSTs from a single source with worker restart events in supervisor or systemd logs.
Monitoring Recommendations
- Alert on sudden spikes in PHP worker respawns, OPcache resets, or FPM pool restarts.
- Monitor libxml error logs for recurring attribute-related warnings tied to sanitization requests.
- Track request-to-worker-crash ratios on SVG ingestion endpoints as a leading availability indicator.
How to Mitigate CVE-2026-107379
Immediate Actions Required
- Upgrade darylldoyle/svg-sanitizer to version 1.0.0 or later across all PHP projects.
- Rate-limit or require authentication on endpoints that accept SVG uploads to limit attacker throughput.
- Reject SVG payloads containing inline <!DOCTYPE> declarations at the application boundary where feasible.
Patch Information
The fix is published in svg-sanitizer release 1.0.0. The specific code change is available in the upstream GitHub commit 23877db, which prevents the duplicate DOMElement::removeAttribute() call on attributes affected by DTD #FIXED defaults. Update via Composer with composer require darylldoyle/svg-sanitizer:^1.0.0 and redeploy affected PHP workers.
Workarounds
- Strip DTDs from inbound SVGs using LIBXML_NONET and a preprocessing step that removes <!DOCTYPE> blocks before invoking the sanitizer.
- Isolate SVG processing in dedicated short-lived workers with automatic restart policies to contain the impact of crashes.
- Place a web application firewall rule in front of upload endpoints to block SVG bodies containing #FIXED attribute defaults until patching is complete.
# Upgrade svg-sanitizer to the patched release
composer require darylldoyle/svg-sanitizer:^1.0.0
composer update darylldoyle/svg-sanitizer
# Verify installed version
composer show darylldoyle/svg-sanitizer | grep versions
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

