# Safe SVG <= 2.5.1 - Authenticated (Author+) Stored Cross-Site Scripting via SVG File Upload

- **ID:** WPSEC-2026-1787
- **Plugin:** Safe SVG (`safe-svg`), https://wordpress.org/plugins/safe-svg/
- **Affected versions:** all versions before 2.5.2
- **Fixed in:** 2.5.2 (Update to 2.5.2 or later.)
- **Severity:** Medium 5.4 (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N)
- **Weakness:** CWE-79
- **Usage among sites WPSec scans:** plugin High, affected versions High (as of 2026-10-27)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/safe-svg
- **Fix released:** 2026-10-26
- **Published:** 2026-10-27
- **URL:** https://wpsec.com/vuln/WPSEC-2026-1787/

## Description

The Safe SVG plugin for WordPress is vulnerable to Stored Cross-Site Scripting via SVG file uploads in all versions up to, and including, 2.5.1. This is due to insufficient sanitization in the bundled enshrined/svg-sanitize library (1.0.0), which kept the attributeName attribute on allowed SMIL animation elements such as animateTransform, so an animation could rewrite a link's href into a javascript: URI after sanitization. This makes it possible for authenticated attackers with Author-level access and above, or any role allowed to upload SVG files, to upload SVG files that execute arbitrary web scripts when a user clicks a link in the SVG in a browser that allows this retargeting, such as Safari, whether the file is opened directly or shown inline by the Safe SVG block.

## References

- https://wpsec.com/vuln/WPSEC-2026-1787/
- https://plugins.svn.wordpress.org/safe-svg/tags/2.5.2/
- https://wordpress.org/plugins/safe-svg/

Source: WPSec, https://wpsec.com/vuln/WPSEC-2026-1787/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Free to use, share and adapt, also commercially, if you credit WPSec and link to this advisory.
