CVE-2025-57977
Executive Summary
CVE-2025-57977 is a Cross-Site Request Forgery (CSRF) vulnerability in the WordPress plugin Flexible PDF Invoices for WooCommerce & WordPress by Wpdesk. This flaw allows an attacker to trick an authenticated administrator into performing unintended actions, such as modifying plugin settings or generating fraudulent invoices, without their consent. The vulnerability affects all versions up to and including 6.0.13. As of this report, no official patch has been released, and no public proof-of-concept (PoC) or exploit code is available. The CVSS score of 7.1 (High) reflects the potential for significant impact on confidentiality and integrity, though user interaction is required.
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 distributed via the official WordPress plugin repository. Users who installed the plugin directly from the WordPress dashboard or via the repository are affected. No supply chain compromise has been identified, but the lack of a patch increases the risk of exploitation through third-party or unofficial sources.
CVSS Breakdown & Threat Level
- CVSS Score: 7.1 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
- Attack Vector (AV): Network – The attack can be launched remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): None – The attacker does not need prior authentication.
- User Interaction (UI): Required – The victim must click a malicious link or visit a crafted page.
- Scope (S): Unchanged – The vulnerable component remains the same.
- Confidentiality (C): High – Sensitive invoice data could be exposed.
- Integrity (I): High – Invoice content or plugin settings could be altered.
- Availability (A): None – No direct impact on availability.
Threat Level: High. While exploitation requires user interaction, the potential for data theft and manipulation of financial documents makes this a serious risk for WooCommerce stores.
Deep Dive & Mechanics
The vulnerability stems from a missing or insufficient CSRF token validation in the plugin's administrative functions. In WordPress, CSRF protection is typically implemented via nonces (number used once). The flexible-invoices plugin fails to verify these nonces on certain state-changing requests, such as saving settings, generating invoices, or modifying templates.
An attacker can craft a malicious HTML page or email that, when viewed by an authenticated administrator, triggers a forged request to the WordPress admin area. For example, the attacker could change the invoice prefix, modify tax rates, or export sensitive customer data. Because the request appears to come from the authenticated user, the server processes it without question.
The vulnerability is particularly dangerous because:
- It targets a plugin handling financial documents (invoices).
- No authentication is required to initiate the attack.
- The impact includes both data theft (confidentiality) and data manipulation (integrity).
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is presumed to be present in all versions <= 6.0.13. A typical vulnerable pattern in WordPress plugins is:
Vulnerable Code (example):
// In admin/settings.php
function save_invoice_settings() {
// Missing nonce check
update_option('invoice_prefix', $_POST['invoice_prefix']);
// ... other settings
}
add_action('admin_post_save_invoice_settings', 'save_invoice_settings');
Patched Code (expected):
function save_invoice_settings() {
// Verify nonce
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'save_invoice_settings_nonce')) {
wp_die('Security check failed.');
}
update_option('invoice_prefix', sanitize_text_field($_POST['invoice_prefix']));
// ... other settings
}
add_action('admin_post_save_invoice_settings', 'save_invoice_settings');
The patch would add a call to wp_verify_nonce() before processing any state-changing request.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- A WordPress site with Flexible PDF Invoices <= 6.0.13 installed and activated.
- An authenticated admin user (victim) who will click the malicious link.
Exploit Steps:
- Craft the CSRF Payload: Create an HTML page that automatically submits a form to the vulnerable endpoint. For example, to change the invoice prefix:
<html> <body> <form action="http://target.com/wp-admin/admin-post.php" method="POST"> <input type="hidden" name="action" value="save_invoice_settings"> <input type="hidden" name="invoice_prefix" value="MALICIOUS-"> <input type="submit" value="Click me"> </form> <script>document.forms[0].submit();</script> </body> </html> - Host the Payload: Place the HTML file on an attacker-controlled server or use a URL shortener.
- Deliver the Payload: Send the link to the victim via email, social media, or a compromised site.
- Trigger the Attack: When the victim visits the link while logged into WordPress, the form auto-submits, changing the invoice prefix.
Expected Outcome: The attacker can modify plugin settings, generate fraudulent invoices, or export sensitive data.
Blue Team (Defense & Detection)
Detection Steps:
- Monitor Admin Actions: Log all
admin_post_*actions and look for unexpected changes to plugin settings. - Check Referer Headers: Incoming requests to admin endpoints should have a valid
Refererheader from the same site. - Audit Nonce Usage: Review the plugin code for missing nonce checks on state-changing functions.
Mitigation:
- Immediate: Disable the plugin until a patch is available.
- Workaround: Implement a Web Application Firewall (WAF) rule to block requests to
admin-post.phpwith suspicious parameters. - User Training: Educate administrators about phishing attacks and the importance of not clicking unknown links while logged in.
Indicators of Compromise (IOCs)
- Network:
- HTTP POST requests to
/wp-admin/admin-post.phpwithaction=save_invoice_settingsor similar plugin-specific actions. - Unusual
Refererheaders (e.g., from external domains).
- HTTP POST requests to
- Host:
- Unexpected changes to WordPress options like
invoice_prefix,invoice_template, orinvoice_logo. - New or modified invoice files in the uploads directory.
- Unexpected changes to WordPress options like
- Logs:
- WordPress debug log entries showing failed nonce checks (if patched) or missing nonce warnings.
Detection Engineering
YARA Rule
rule Detect_Flexible_Invoices_CSRF {
meta:
description = "Detects potential CSRF exploitation attempts against Flexible PDF Invoices plugin"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-57977"
strings:
$action = "save_invoice_settings" nocase
$prefix = "invoice_prefix" nocase
$template = "invoice_template" nocase
condition:
any of ($action, $prefix, $template) and
# of ($action, $prefix, $template) >= 2
}
Sigma Rule
title: CSRF Exploitation Attempt Against Flexible PDF Invoices
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP POST requests targeting admin-post.php with plugin-specific parameters
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'admin-post.php'
cs-uri-query|contains|all:
- 'action=save_invoice_settings'
- 'invoice_prefix'
condition: selection
falsepositives:
- Legitimate admin actions
level: high
Suricata Rule
alert http any any -> $HOME_NET any (
msg:"CVE-2025-57977 - CSRF Attempt Against Flexible PDF Invoices";
flow:to_server,established;
http.method; content:"POST";
http.uri; content:"/wp-admin/admin-post.php";
http.client_body; content:"action=save_invoice_settings";
http.client_body; content:"invoice_prefix";
classtype:attempted-admin;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the Plugin: Deactivate and uninstall Flexible PDF Invoices until a patched version is released.
- Review Logs: Check for any unauthorized changes to invoice settings or data exports.
- Reset Admin Passwords: Force password changes for all admin users as a precaution.
Long-Term Fix:
- Apply Patch: Once the vendor releases an update (e.g., version 6.0.14 or higher), update immediately.
- Implement CSRF Protection: Ensure all state-changing actions in custom plugins use WordPress nonces (
wp_nonce_field(),check_admin_referer()).
Workarounds (if plugin cannot be disabled):
- WAF Rule: Block POST requests to
admin-post.phpthat contain plugin-specific parameters without a valid nonce. - Additional Authentication: Require re-authentication for sensitive actions (e.g., changing invoice templates).
Monitoring:
- Enable WordPress debug logging (
WP_DEBUG_LOG) to capture any suspicious activity. - Use a security plugin (e.g., Wordfence) to monitor for CSRF attempts.
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.