# Safe SVG <= 2.5.1 - Authenticated (Contributor+) CSS Injection via Safe SVG Block Attributes

- **ID:** WPSEC-2026-1786
- **Plugin:** Safe SVG (`safe-svg`), https://wordpress.org/plugins/safe-svg/
- **Affected versions:** from 2.1.0 before 2.5.2
- **Fixed in:** 2.5.2 (Update to 2.5.2 or later.)
- **Severity:** Medium 5.0 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:N)
- **Weakness:** CWE-74
- **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-1786/

## Description

The Safe SVG plugin for WordPress is vulnerable to CSS Injection via the Safe SVG block's alignment, backgroundColor, textColor and spacing attributes in all versions up to, and including, 2.5.1. This is due to the block's render callback placing these values into inline style attributes with only esc_attr(), which does not stop extra CSS declarations. This makes it possible for authenticated attackers with Contributor-level access and above to inject arbitrary CSS declarations into pages that contain the block, for example to overlay or restyle page content for visitors.

## References

- https://wpsec.com/vuln/WPSEC-2026-1786/
- 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-1786/

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.
