# Autoptimize <= 3.1.16 - Authenticated (Contributor+) Stored Cross-Site Scripting via Google Fonts Optimization

- **ID:** WPSEC-2026-1673
- **Plugin:** Autoptimize (`autoptimize`), https://wordpress.org/plugins/autoptimize/
- **Affected versions:** all versions before 3.1.17
- **Fixed in:** 3.1.17 (Update to 3.1.17 or later.)
- **Severity:** Medium 4.9 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/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/autoptimize
- **Fix released:** 2026-10-25
- **Published:** 2026-10-26
- **URL:** https://wpsec.com/vuln/WPSEC-2026-1673/

## Description

The Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the Google Fonts optimization feature in all versions up to, and including, 3.1.16 due to insufficient output escaping of the font-family string taken from Google Fonts URLs found in the page HTML. That string, which is URL-decoded for Google Fonts API v2 URLs, is placed without escaping into the href attribute of the combined Google Fonts <link> tag. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an affected page. Exploitation requires the Google Fonts option to be set to one of the non-default 'combine and link' or 'combine and preload' modes.

## References

- https://wpsec.com/vuln/WPSEC-2026-1673/
- https://plugins.svn.wordpress.org/autoptimize/tags/3.1.17/
- https://wordpress.org/plugins/autoptimize/

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

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.
