Ajax Load More – Infinite Scroll, Load More, & Lazy Load < 7.8.4 - Unauthenticated Stored Cross-Site Scripting
Description
The Ajax Load More – Infinite Scroll, Load More, & Lazy Load plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to 7.8.4 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.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:NTechnical Details
What Changed in the Fix
Changes introduced in v7.8.4
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-6495 (Ajax Load More Stored XSS) ## 1. Vulnerability Summary The **Ajax Load More** plugin (versions < 7.8.4) is vulnerable to **Unauthenticated Stored Cross-Site Scripting (XSS)**. The vulnerability exists because the plugin's AJAX handler for loading posts (…
Show full research plan
Exploitation Research Plan: CVE-2026-6495 (Ajax Load More Stored XSS)
1. Vulnerability Summary
The Ajax Load More plugin (versions < 7.8.4) is vulnerable to Unauthenticated Stored Cross-Site Scripting (XSS). The vulnerability exists because the plugin's AJAX handler for loading posts (alm_get_posts) accepts query and display parameters from unauthenticated users and, when the "Cache" or "SEO" features are active, stores these parameters in WordPress transients without sufficient sanitization.
The "Storage" occurs in the transient database (wp_options table), and the "Sink" occurs when the cached data is loaded and rendered via the [ajax_load_more] shortcode on a public-facing page or within the plugin's preview environment (ALM_PREVIEW).
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action:
alm_get_posts(unauthenticated viawp_ajax_nopriv_alm_get_posts) - Vulnerable Parameter:
container_type,transition, orbutton_label. These parameters are often used to construct HTML elements. - Authentication: None (Unauthenticated).
- Preconditions: The target site must have a page using the
[ajax_load_more]shortcode with thecache="true"attribute and a known or predictable `cache
Summary
The Ajax Load More plugin is vulnerable to Unauthenticated Stored Cross-Site Scripting because it fails to sanitize user-supplied query parameters in its AJAX handler and preview functions. Attackers can inject malicious scripts into WordPress transients (cache) or directly into the preview rendering process, which then executes in the browser of any user viewing the affected page or preview.
Vulnerable Code
// core/classes/class-alm-preview.php line 35 $params = filter_input_array( INPUT_GET ); $shortcode = isset( $params['alm_preview'] ) ? $params['alm_preview'] : false; --- // core/classes/class-alm-preview.php line 162 <pre id="alm-pre"><?php echo wp_kses_post( $shortcode ); ?></pre> </div> <div id="alm-preview-wrap"> <?php echo do_shortcode( $shortcode ); ?> </div>
Security Fix
@@ -32,14 +31,14 @@ */ public function alm_preview() { $params = filter_input_array( INPUT_GET ); - $shortcode = isset( $params['alm_preview'] ) ? $params['alm_preview'] : false; + $shortcode = isset( $params['alm_preview'] ) ? wp_strip_all_tags( $params['alm_preview'] ) : false; if ( $shortcode && str_contains( $shortcode, '[ajax_load_more' ) && current_user_can( apply_filters( 'alm_user_role', 'edit_theme_options' ) ) ) { get_header(); - // Set cache to false. - $shortcode = str_replace( 'cache="true"', '', $shortcode ); - // Create Preview + $shortcode = str_replace( 'cache="true"', '', $shortcode ); // Set cache to false. + + // Create Preview. ?> <style> html { @@ -159,17 +158,16 @@ <p> <?php echo wp_kses_post( __( '<strong>Note:</strong> Styling and functionality within this preview environment may not be 100% reflective of how Ajax Load More will appear once added directly to a page on your website.', 'ajax-load-more' ) ); ?> </p> - <pre id="alm-pre"><?php echo wp_kses_post( $shortcode ); ?></pre> + <pre id="alm-pre"><?php echo esc_html( $shortcode ); ?></pre> </div> <div id="alm-preview-wrap"> <?php echo do_shortcode( $shortcode ); ?> </div> </div> <script> - // Move elements with JS. document.title = "Ajax Load More: Preview"; var container = document.querySelector("#alm-preview"); - document.body.append(container); + document.body.append(container); // Move container with JS. </script> <?php get_footer();
Exploit Outline
1. An unauthenticated attacker targets the WordPress AJAX endpoint `/wp-admin/admin-ajax.php` using the `alm_get_posts` action. 2. The attacker sends a request including malicious HTML/JavaScript payloads in query parameters that define the UI, such as `button_label`, `container_type`, or `transition` (e.g., `button_label=<script>alert(document.domain)</script>`). 3. If the plugin's 'Cache' or 'SEO' feature is active for the target shortcode, the plugin saves these unsanitized parameters into a WordPress transient (database-backed cache). 4. When a legitimate user or administrator visits a page where the `[ajax_load_more]` shortcode is rendered with caching enabled, the plugin retrieves the malicious payload from the transient and reflects it onto the page. 5. The script executes in the context of the victim's session, potentially allowing for session hijacking or further administrative actions.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.