# CVE-2026-107381: svg-sanitizer: Mixed-case xlink:HrEf skips the `<use>` nesting-DoS check in Resolver::processReferences

> Attackers can bypass nesting limits in svg-sanitizer via mixed-case attributes, causing resource exhaustion in applications rendering sanitized SVGs.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Oct 2026
- **Updated:** 18 Oct 2026
- **Also known as:** GHSA-m9xh-6747-9r6f

## What is CVE-2026-107381?

CVE-2026-107381 is a medium-severity denial of service vulnerability in darylldoyle svg-sanitizer, published on 14 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

svg-sanitizer is a PHP SVG/XML sanitizer. Prior to 1.0.0, Resolver::processReferences() in src/ElementReference/Resolver.php builds the SVG <use> reference graph with a case-sensitive href attribute predicate before cleanHrefAttributes() normalizes mixed-case names. An attacker can provide xlink:HrEf on nested <use> elements so the graph omits those references, after which the sanitizer converts the attribute to canonical xlink:href and returns the live nesting structure without applying the useNestingLimit protection. A consuming application that renders the sanitized SVG can therefore be exposed to the resource exhaustion that control is designed to prevent. This issue is fixed in version 1.0.0.

Weakness: CWE-400 (Uncontrolled Resource Consumption), CWE-178 (Improper Handling of Case Sensitivity)

## Which versions are affected by CVE-2026-107381?

2 open source packages ship an affected version, including enshrined/svg-sanitize.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `enshrined/svg-sanitize` | Packagist | All versions | 1.0.0 |
| `enshrined/svg-sanitize` | Packagist | All versions | 1.0.0 |

## How do I fix CVE-2026-107381?

Upgrade enshrined/svg-sanitize to 1.0.0 or later.

## Is CVE-2026-107381 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-107381 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-107381 and fix it if it is affected.

What it is: CVE-2026-107381 is a medium-severity denial of service vulnerability in darylldoyle svg-sanitizer, published on 14 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-107381 exists.

Affected packages and fixed versions:
- enshrined/svg-sanitize (Packagist): affected all versions; fixed in 1.0.0
- enshrined/svg-sanitize (Packagist): affected all versions; fixed in 1.0.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-107381/ (Markdown: https://insights.sbomify.com/CVE-2026-107381/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-107381
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-107381
- OSV: https://osv.dev/vulnerability/CVE-2026-107381

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-107381/
Summaries are generated and may contain mistakes; the official description above is the record.
