---
id: "CVE-2026-117540"
kind: "vulnerability"
aliases: ["CVE-2026-117540"]
title: "svg-sanitizer: crafted SVG upload exhausts CPU in sanitize()"
severity: "high"
cvss: 8.7
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["composer", "package", "php", "self-hosted", "svg-upload"]
not_affected_if: ["library-not-used", "no-svg-upload"]
published_at: "2026-10-27T11:17:34+00:00"
first_seen_at: "2026-10-27T11:31:28+00:00"
updated_at: "2026-10-27T11:31:38+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-117540", "first_seen_at": "2026-10-27T11:31:28+00:00"}]
---

# svg-sanitizer: crafted SVG upload exhausts CPU in sanitize()

svg-sanitizer versions from 0.5.3 before 1.1.0 rescan the whole input repeatedly while stripping PHP tags, so the cost grows quadratically with input size. An unauthenticated attacker who uploads an SVG with many overlapping PHP tag openers and closers can tie up worker CPU for minutes.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version of svg-sanitizer with `composer show enshrined/svg-sanitizer` (unknown if the sources do not name this exact package path; confirm the vendor name)
- Search the lock file for svg-sanitizer and look for a version from `0.5.3` up to but not including `1.1.0`
- Find code paths that call `Sanitizer::sanitize()` on user-uploaded SVG files

## Fix

- Upgrade svg-sanitizer to `1.1.0` or later
- Until upgraded, reject or size-limit uploaded SVG files before sanitizing them

## Timeline

- 2026-10-27T11:31:28+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-117540

## From the sources

svg-sanitizer from 0.5.3 before 1.1.0 contains a denial of service vulnerability in Sanitizer::sanitize() that repeatedly rescans the whole input while stripping PHP tags. Unauthenticated attackers can upload SVGs with many overlapping PHP tag openers and closers, forcing quadratic preg_replace passes that exhaust worker CPU for minutes.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
