Skip to content
Laskyr

Plugins · autoptimize · data as of 2026-11-01

Is Autoptimize safe? Known vulnerabilities and latest version

No known unpatched vulnerabilities in the latest version (3.1.17)

As of 2026-11-01. 12 issues are on record for older versions; version 3.1.16 or newer fixes all of them that state a fix.

Latest version
3.1.17
Last updated
2026-10-25
Active installs
800,000+
Known issues on record
12
Unpatched in latest
0
Tested up to WP
7.1.4 · PHP 7.4+

Autoptimize speeds up your website by optimizing JS, CSS, images (incl. lazy-load), HTML and Google Fonts, asyncing JS, removing emoji cruft and more. — by Optimizing Matters

What to do

  1. Update to the latest version (3.1.17). Anything older than 3.1.16 has at least one known issue listed below. Dashboard → Updates, or Plugins → “update now”.
  2. If you cannot update right away, deactivate it until you can.
  3. Turn on auto-updates for it: Plugins → “Enable auto-updates” on its row.
  4. If you ran a vulnerable version and something looks off (spam pages, strange admins, redirects), run the free scan.

With WP-CLI: wp plugin get autoptimize --field=version shows what you run; wp plugin update autoptimize updates it.

Check your version

Known vulnerabilities

12 on record, newest first. “Affected” is the version range the source gives; “fixed in” is the version the source names, or (marked *) the first wordpress.org release after the last affected version.

medium 5.4 CVE-2026-78471 · published 2026-10-02

Stored cross-site scripting (XSS) in Autoptimize (3.1.15.1 and older)

Affected
3.1.15.1 and older
Fixed in
3.1.16 *
Access needed (per CVSS)
No login needed
Range from
CVE record (the advisory publisher) · score by Wordfence
Details from the advisory

The Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via Comment Author Name in all versions up to, and including, 3.1.15.1 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. Exploitation requires an administrator to have enabled Autoptimize's 'Lazy-load images?' option, the w3-total-cache/w3-total-cache.php file to be present on disk with the plugin disabled, a class named Minify_HTML to be loaded into scope by another plugin, and the malicious comment to be approved by a moderator before the payload renders.

NVD CVE-2026-78471Wordfence advisoryCode change (fix)Plugin source

high 7.2 CVE-2026-14995 · published 2026-10-01

Stored cross-site scripting (XSS) in Autoptimize (3.1.15.1 and older)

Affected
3.1.15.1 and older
Fixed in
3.1.16 *
Access needed (per CVSS)
No login needed
Range from
CVE record (the advisory publisher) · score by Wordfence
Details from the advisory

The Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via REQUEST_URI Path in all versions up to, and including, 3.1.15.1 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. Exploitation requires the Critical CSS feature to be active with a valid API key configured, as this is the precondition for unauthenticated frontend requests to trigger queue entries via ao_ccss_enqueue().

NVD CVE-2026-14995Wordfence advisoryCode change (fix)Plugin source

medium 6.4 CVE-2026-2430 · published 2026-03-21

Stored cross-site scripting (XSS) in Autoptimize (3.1.14 and older)

Affected
3.1.14 and older
Fixed in
3.1.15 *
Access needed (per CVSS)
Needs a low-level account (e.g. subscriber)
Range from
CVE record (the advisory publisher) · score by Wordfence
Details from the advisory

The Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the lazy-loading image processing in all versions up to, and including, 3.1.14. This is due to the use of an overly permissive regular expression in the `add_lazyload` function that replaces all occurrences of `\ssrc=` in image tags without limiting to the actual attribute. 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 injected page by crafting an image tag where the `src` URL contains a space followed by `src=`, causing the regex to break the HTML structure and promote text inside attribute values into executable HTML attributes.

NVD CVE-2026-2430Wordfence advisoryCode change (fix)github.comPlugin source

medium 6.4 CVE-2026-2352 · published 2026-03-21

Stored cross-site scripting (XSS) in Autoptimize (3.1.14 and older)

Affected
3.1.14 and older
Fixed in
3.1.15 *
Access needed (per CVSS)
Needs a low-level account (e.g. subscriber)
Range from
CVE record (the advisory publisher) · score by Wordfence
Details from the advisory

The Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'ao_post_preload' meta value in all versions up to, and including, 3.1.14. This is due to insufficient input sanitization in the `ao_metabox_save()` function and missing output escaping when the value is rendered into a `<link>` tag in `autoptimizeImages.php`. 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 injected page, granted the "Image optimization" or "Lazy-load images" setting is enabled in the plugin configuration.

NVD CVE-2026-2352Wordfence advisoryCode change (fix)github.comPlugin source

medium 6.4 CVE-2025-13401 · published 2025-12-03

Stored cross-site scripting (XSS) in Autoptimize (3.1.13 and older)

Affected
3.1.13 and older
Fixed in
3.1.14 *
Access needed (per CVSS)
Needs a low-level account (e.g. subscriber)
Range from
CVE record (the advisory publisher) · score by Wordfence
Details from the advisory

The Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the LCP Image to preload metabox in all versions up to, and including, 3.1.13 due to insufficient input sanitization and output escaping on user-supplied image attributes in the "create_img_preload_tag" function. 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 injected page.

NVD CVE-2025-13401Wordfence advisoryCode change (fix)

medium 4.8 CVE-2023-2113 · published 2023-05-30

Security issue in Autoptimize (older than 3.1.7)

Affected
older than 3.1.7
Fixed in
3.1.7
Access needed (per CVSS)
Needs an admin-level account; someone on the site has to click a link or open a page
Range from
CVE record (the advisory publisher) · score by NVD
Details from the advisory

The Autoptimize WordPress plugin before 3.1.7 does not sanitise and escape the settings imported from a previous export, allowing high privileged users (such as an administrator) to inject arbitrary javascript into the admin panel, even when the unfiltered_html capability is disabled, such as in a multisite setup.

NVD CVE-2023-2113WPScan advisory

medium 5.3 CVE-2022-4057 · published 2023-01-02

Security issue in Autoptimize (older than 3.1.0)

Affected
older than 3.1.0
Fixed in
3.1.0
Access needed (per CVSS)
No login needed
Range from
CVE record (the advisory publisher) · score by NVD
Details from the advisory

The Autoptimize WordPress plugin before 3.1.0 uses an easily guessable path to store plugin's exported settings and logs.

NVD CVE-2022-4057WPScan advisory

medium 4.8 CVE-2022-2635 · published 2022-09-16

Stored cross-site scripting (XSS) in Autoptimize (older than 3.1.1)

Affected
older than 3.1.1
Fixed in
3.1.1
Access needed (per CVSS)
Needs an admin-level account; someone on the site has to click a link or open a page
Range from
NVD analysis · score by NVD
Details from the advisory

The Autoptimize WordPress plugin before 3.1.1 does not sanitise and escape some of its settings, which could allow high privilege users such as admin to perform Stored Cross-Site Scripting attacks even when the unfiltered_html capability is disallowed (for example in multisite setup)

NVD CVE-2022-2635WPScan advisory

critical 9.8 CVE-2021-24376 · published 2021-06-21

Remote code execution in Autoptimize (older than 2.7.8)

Affected
older than 2.7.8
Fixed in
2.7.8
Access needed (per CVSS)
No login needed
Range from
NVD analysis · score by NVD
Details from the advisory

The Autoptimize WordPress plugin before 2.7.8 attempts to delete malicious files (such as .php) form the uploaded archive via the "Import Settings" feature, after its extraction. However, the extracted folders are not checked and it is possible to upload a zip which contained a directory with PHP file in it and then it is not removed from the disk. It is a bypass of CVE-2020-24948 which allows sending a PHP file via the "Import Settings" functionality to achieve Remote Code Execution.

NVD CVE-2021-24376WPScan advisory

high 8.1 CVE-2021-24377 · published 2021-06-21

Remote code execution in Autoptimize (older than 2.7.8)

Affected
older than 2.7.8
Fixed in
2.7.8
Access needed (per CVSS)
No login needed
Range from
NVD analysis · score by NVD
Details from the advisory

The Autoptimize WordPress plugin before 2.7.8 attempts to remove potential malicious files from the extracted archive uploaded via the 'Import Settings' feature, however this is not sufficient to protect against RCE as a race condition can be achieved in between the moment the file is extracted on the disk but not yet removed. It is a bypass of CVE-2020-24948.

NVD CVE-2021-24377WPScan advisory

medium 4.8 CVE-2021-24378 · published 2021-06-21

Cross-site scripting (XSS) in Autoptimize (older than 2.7.8)

Affected
older than 2.7.8
Fixed in
2.7.8
Access needed (per CVSS)
Needs an admin-level account; someone on the site has to click a link or open a page
Range from
NVD analysis · score by NVD
Details from the advisory

The Autoptimize WordPress plugin before 2.7.8 does not check for malicious files such as .html in the archive uploaded via the 'Import Settings' feature. As a result, it is possible for a high privilege user to upload a malicious file containing JavaScript code inside an archive which will execute when a victim visits index.html inside the plugin directory.

NVD CVE-2021-24378WPScan advisory

medium 4.8 CVE-2021-24332 · published 2021-05-24

Stored cross-site scripting (XSS) in Autoptimize (older than 2.8.4)

Affected
older than 2.8.4
Fixed in
2.8.4
Access needed (per CVSS)
Needs an admin-level account; someone on the site has to click a link or open a page
Range from
NVD analysis · score by NVD
Details from the advisory

The Autoptimize WordPress plugin before 2.8.4 was missing proper escaping and sanitisation in some of its settings, allowing high privilege users to set XSS payloads in them, leading to stored Cross-Site Scripting issues

NVD CVE-2021-24332WPScan advisorym0ze.ru

Recent activity

Where this data comes from

Badge for your site or docs (states facts with a date, not a verdict):
Autoptimize vulnerability status badge
<a href="https://laskyr.com/plugins/autoptimize"><img src="https://laskyr.com/plugins/autoptimize/badge.svg" alt="Autoptimize vulnerability status"></a>

← Check another plugin · Free hacked-site scan

Site hacked? Get help now
Run free scan Fix it now ($499) Send a message

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit