CVE-2025-11981
Executive Summary
CVE-2025-11981 is a critical SQL Injection vulnerability discovered in the WPSchoolPress WordPress plugin, specifically within the School Management System. The flaw resides in the SCodes parameter, which is insufficiently sanitized before being used in SQL queries. This allows authenticated attackers with administrator-level privileges to inject arbitrary SQL commands, potentially leading to the extraction of sensitive data from the WordPress database, including user credentials, personal information, and other confidential records.
As a WordPress plugin vulnerability, this issue directly impacts the WordPress ecosystem and does not involve underlying web server software like Apache or Nginx. The vulnerability affects all versions up to and including 2.2.23, and as of this report, no official patch has been released by the vendor.
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 is specific to the WordPress plugin ecosystem. The WPSchoolPress plugin is distributed through the official WordPress plugin repository and third-party marketplaces. Organizations using this plugin should treat it as a critical supply chain risk, as the unpatched state means any deployment is inherently vulnerable. Administrators should monitor the plugin’s update channel and consider temporary removal or strict access controls until a patch is available.
CVSS Breakdown & Threat Level
- CVSS Score: 4.9 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: High (Administrator)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: None
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate due to the high privilege requirement, the potential for data exfiltration makes this a serious concern for any organization using the plugin. An attacker with admin access can extract the entire database, including password hashes and user data.
Deep Dive & Mechanics
The vulnerability exists in the SCodes parameter handling within the WPSchoolPress plugin. The plugin fails to properly escape user-supplied input and does not prepare SQL statements correctly, leading to a classic SQL injection flaw.
Root Cause: The SCodes parameter is directly concatenated into an SQL query without using prepared statements or proper sanitization. This allows an authenticated administrator to inject SQL commands by crafting malicious input.
Attack Flow:
- An attacker gains administrator-level access to the WordPress site (e.g., through credential theft, social engineering, or other means).
- The attacker navigates to a vulnerable endpoint that processes the
SCodesparameter. - The attacker injects SQL payloads into the
SCodesparameter, such as' OR '1'='1or more complex UNION-based queries. - The injected SQL is executed against the database, allowing the attacker to extract sensitive information.
Impact: Successful exploitation can lead to the disclosure of the entire WordPress database, including user tables, post content, and configuration data. This can be used for further attacks, such as privilege escalation or lateral movement within the network.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on best practices.
Vulnerable Code (Conceptual):
$scodes = $_POST['SCodes'];
$query = "SELECT * FROM wp_students WHERE code = '$scodes'";
$result = $wpdb->get_results($query);
Patched Code (Conceptual):
$scodes = sanitize_text_field($_POST['SCodes']);
$query = $wpdb->prepare("SELECT * FROM wp_students WHERE code = %s", $scodes);
$result = $wpdb->get_results($query);
The patched version uses $wpdb->prepare() to parameterize the query, preventing SQL injection. Additionally, input is sanitized using sanitize_text_field().
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress instance with WPSchoolPress plugin version <= 2.2.23
- Administrator credentials
Exploitation Steps:
- Log in to WordPress as an administrator.
- Identify the vulnerable endpoint (e.g.,
/wp-admin/admin-ajax.php?action=wpsp_get_students). - Craft a POST request with the
SCodesparameter containing SQL injection payload.
Example Payload:
' UNION SELECT user_login, user_pass, user_email FROM wp_users --
Proof-of-Concept Request:
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: target-wordpress-site.com
Content-Type: application/x-www-form-urlencoded
Cookie: [admin session cookie]
action=wpsp_get_students&SCodes=' UNION SELECT user_login, user_pass, user_email FROM wp_users --
Expected Output: The response will include user credentials from the wp_users table.
Blue Team
Detection:
- Monitor for unusual SQL queries in database logs.
- Look for POST requests to
admin-ajax.phpwith suspiciousSCodesparameters containing SQL keywords (e.g.,UNION,SELECT,OR). - Use Web Application Firewall (WAF) rules to block SQL injection patterns.
Hunting:
- Search for
SCodesparameter in HTTP logs and inspect for non-alphanumeric characters. - Correlate with administrator account activity to identify potential compromised accounts.
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/wp-admin/admin-ajax.phpwithaction=wpsp_get_studentsandSCodesparameter containing SQL syntax. - Outbound database queries containing
UNION,SELECT, orFROMin unexpected contexts.
- POST requests to
Host IOCs:
- Unusual entries in WordPress database logs.
- Modified or new administrator accounts.
- Presence of SQL injection tools or scripts on the server.
File IOCs:
- Suspicious entries in
wp-content/debug.logindicating SQL errors. - Modified plugin files in
/wp-content/plugins/wpschoolpress/.
- Suspicious entries in
Detection Engineering
YARA Rule
rule CVE_2025_11981_WPSchoolPress_SQLi {
meta:
description = "Detects SQL injection attempts targeting WPSchoolPress SCodes parameter"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-11981"
strings:
$s1 = "SCodes" nocase
$s2 = "UNION" nocase
$s3 = "SELECT" nocase
$s4 = "FROM" nocase
$s5 = "wp_users" nocase
condition:
all of ($s1, $s2, $s3, $s4) or ($s1 and $s5)
}
Sigma Rule
title: CVE-2025-11981 WPSchoolPress SQL Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts against WPSchoolPress SCodes parameter
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-11981
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'action=wpsp_get_students'
cs-uri-query|contains: 'SCodes='
sc-status: 200
keywords:
- 'UNION'
- 'SELECT'
- 'FROM'
- 'OR'
- 'AND'
condition: selection and keywords
falsepositives:
- Legitimate use of SQL keywords in non-malicious context (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-11981 WPSchoolPress SQL Injection Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=wpsp_get_students"; http_client_body; content:"SCodes="; http_client_body; pcre:"/(UNION|SELECT|FROM|OR|AND)/Ri"; classtype:web-application-attack; sid:10000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Plugin: If the plugin is not critical, deactivate and delete it until a patch is available.
- Restrict Admin Access: Limit administrator accounts to only trusted users and enforce strong passwords and multi-factor authentication.
- Web Application Firewall (WAF): Deploy WAF rules to block SQL injection patterns in the
SCodesparameter.
Long-Term Fix:
- Vendor Patch: Await an official update from WPSchoolPress. Monitor their website or WordPress plugin repository for version 2.2.24 or later.
- Code Hardening: If you have access to the source code, apply parameterized queries using
$wpdb->prepare()and sanitize all user inputs.
Workaround:
- Implement a custom filter in WordPress to block requests containing SQL keywords in the
SCodesparameter.
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.