Severity:

HIGH RISK

(7.3)

SQL Injection in controller.php of Online Class Record

CVE-2026-2089

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Database Compromise and Data Exfiltration

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The Online Class Record System 1.0 contains a SQL injection flaw in /admin/subject/controller.php, where the ID parameter is incorporated into database queries without adequate sanitization.

An attacker who can send crafted HTTP requests to the vulnerable endpoint may manipulate SQL queries, potentially accessing, modifying, or deleting data in the underlying database.

Affected context

This vulnerability appears in the admin subject management functionality of the Online Class Record System 1.0, specifically within /admin/subject/controller.php.

It manifests when user-supplied input from the ID parameter is used to build SQL statements dynamically, without robust input validation or parameterization.

Any deployment that exposes this administrative interface over a network and does not enforce strict access controls or input handling is potentially affected.

Exploit preconditions

  • Attack surface: HTTP requests to /admin/subject/controller.php
  • Required access: Ability to reach the admin subject controller endpoint (with or without authenticated admin access, depending on how the application is configured)
  • User-controlled input: The ID argument in the request can be manipulated by the client
  • Trigger point: The server constructs and executes a SQL query using the ID value directly or via string concatenation
  • Why exploitation is possible: The application interpolates the ID parameter into SQL statements without proper parameter binding, escaping, or query whitelisting, allowing injected SQL fragments to be interpreted by the database engine

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The application builds SQL queries by concatenating raw request data (the ID parameter) with SQL syntax, rather than using prepared statements or strict query builders.

Additionally, the handling of dynamic data in the SQL context lacks robust validation and encoding (CWE-74), so metacharacters such as quotes, comment markers, or operators are not neutralized.

This insecure pattern lets attacker-controlled input alter the structure and logic of database queries, rather than being treated as plain data.

Potential impact

  • Attackers may read or exfiltrate sensitive information from database tables, such as user records or class data.
  • Database contents can be modified, including tampering with grades, subject records, or other academic information.
  • Records may be deleted, potentially causing loss of integrity and availability of class records.
  • Under certain configurations, attackers could escalate to execute administrative SQL commands, impacting the broader database instance.
  • If the database or environment is misconfigured, SQL injection could be chained to remote code execution or lateral movement.

General mitigation guidance

Effective mitigation centers on removing direct string concatenation of user input in SQL queries and reducing trust in all externally supplied data:

  • Use parameterized queries or prepared statements for all database operations, binding the ID parameter as data rather than embedding it into query strings.
  • Introduce a data access layer or ORM that avoids raw SQL construction and enforces query parameterization by default.
  • Apply strict server-side validation on the ID parameter, ensuring it conforms to expected formats (e.g., integer-only or whitelisted identifiers).
  • Separate database permissions by role, so that the application account uses least privilege and cannot perform unnecessary administrative actions.
  • Implement centralized input handling policies to ensure that all user-controlled parameters are validated before reaching persistence layers.
  • Consider query whitelisting for operations on sensitive tables, limiting which statements can be executed by application code.

How teams detect issues like this

Detection efforts can focus on both code-level analysis and runtime behavior:

  • Use static analysis tools configured with rules for SQL injection to flag dynamic query construction that interpolates request parameters (particularly the ID field) into SQL strings.
  • During code review, look for patterns such as string concatenation in database calls, use of unescaped variables in SQL, and lack of prepared statements in /admin/subject/controller.php and related modules.
  • Implement application-layer logging that records query templates and parameter values separately; monitor logs for anomalous patterns such as injected operators, comments, or UNION clauses.
  • Employ web application firewalls (WAFs) or runtime application self-protection (RASP) that can detect and block common SQL injection patterns in incoming requests.
  • Integrate security checks into CI/CD pipelines so that new or modified database access code is automatically scanned for injection-prone constructs.

Sources

SourceLink
github.comgithub.com/xiaoccm07/cve/issues/2
vuldb.comvuldb.com/?ctiid.344656
vuldb.comvuldb.com/?id.344656
vuldb.comvuldb.com/?submit.746550
sourcecodester.comsourcecodester.com/

Frequently asked

questions

Exploitation is possible from any system that can reach the vulnerable endpoint and control the ID parameter. If the admin area is accessible over the internet and not strongly protected, the exposure is effectively remote and broad.

That depends on the deployment. If the /admin/subject/controller.php endpoint is protected by authentication, the attacker would need valid or compromised credentials; if it is weakly protected or exposed, exploitation may be feasible without logging in.

Refactor all affected queries to use parameterized statements or prepared queries, enforce strict input validation on the ID parameter, and avoid any raw string concatenation when building SQL commands.

Adopt a secure-by-default data access layer that mandates parameter binding, define coding standards that prohibit raw SQL string building with user input, and integrate automated security testing and code review focused on injection patterns into the development lifecycle.

Find out what's already
exploitable in your codebase.