/

CVE-2026-16228

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in Class Timetabling System

CVE-2026-16228

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Data Exposure and Database Manipulation

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 Class and Exam Timetabling System 1.0 contains a SQL injection flaw in the /edit_schoolyr.php endpoint, where the ID parameter is not safely handled before being used in database queries.

A remote attacker can manipulate this parameter to interfere with SQL statements, which may expose or modify timetable data and potentially compromise the underlying database when the vulnerable page is accessible.

Affected context

This vulnerability occurs in web deployments of SourceCodester Class and Exam Timetabling System 1.0 that expose the /edit_schoolyr.php script.

The issue is typically present when user-supplied parameters (such as the ID argument) are directly embedded into SQL queries without using proper parameterization or escaping.

It is most relevant in environments where the application server can reach a relational database and where access to the edit school year functionality is available over the network.

Exploit preconditions

  • Attack surface: HTTP requests sent to the /edit_schoolyr.php endpoint.
  • Required access: Ability to reach the web application over the network; further access constraints depend on how the page is exposed (e.g., authenticated vs. public).
  • Trigger point: Supplying crafted values in the ID parameter so that they are concatenated into SQL statements.
  • Why exploitation is possible: The backend constructs SQL queries using string concatenation or unsafely interpolated variables, allowing attacker-controlled input to alter query structure instead of being treated strictly as data.

Why this happens

The underlying issue is improper neutralization of special elements used in an SQL command (CWE-89), a specific case of injection (CWE-74).

The application appears to construct queries in /edit_schoolyr.php by inserting the ID parameter directly into SQL text without using prepared statements or proper binding.

As a result, input that includes SQL syntax (such as quotes or operators) can change the intended query logic, enabling attackers to execute arbitrary SQL statements within the database session associated with the web application.

Potential impact

  • Attackers may extract sensitive timetable and user-related records from the database.
  • Malicious actors could modify or delete school year and scheduling data, disrupting operations.
  • SQL injection chains may allow creation of new application accounts or escalation of privileges within the system.
  • In certain configurations, attackers can leverage database features to execute server-side commands or pivot to other parts of the infrastructure.

General mitigation guidance

Effective mitigation focuses on removing the injection primitive and tightening data handling boundaries.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations, ensuring the ID parameter is bound as data.
  • Applying strict input validation on identifier fields, enforcing expected formats (e.g., integer-only IDs) before processing.
  • Centralizing database access through a data access layer that prohibits raw query concatenation.
  • Running the database with least-privilege credentials so that, if a query is abused, its capabilities are limited to what the application genuinely needs.
  • Enforcing defense-in-depth controls such as web application firewalls that can help detect and block obvious SQL injection payloads.

How teams detect issues like this

Detection typically combines code-focused and behavior-focused approaches:

  • Static analysis rules to flag dynamic SQL construction using string concatenation or interpolation with request parameters in PHP files (particularly /edit_schoolyr.php).
  • Manual code review patterns that look for direct use of $_GET/$_POST variables in SQL statements, missing prepared statements, and absent validation on critical identifiers.
  • Runtime monitoring of database queries to identify anomalous patterns, such as unexpected logical operators, tautologies, or stacked statements originating from web requests.
  • Integration of automated security testing (e.g., DAST tools) in CI/CD pipelines to probe web endpoints for injection behavior and regressions.

Sources

SourceLink
github.comgithub.com/fichterclapsaddle879-rgb/MyCve/issues/1
vuldb.comvuldb.com/cve/CVE-2026-16228
vuldb.comvuldb.com/submit/858247
vuldb.comvuldb.com/vuln/380050
vuldb.comvuldb.com/vuln/380050/cti
sourcecodester.comsourcecodester.com/

Frequently asked

questions

Exploitability depends on network exposure and access controls, but when /edit_schoolyr.php is reachable and the parameter is not protected, a remote attacker can often exploit it using standard web requests.

That depends on how the application is configured; if the vulnerable endpoint is behind authentication, an attacker would first need access to an account, but if it is publicly accessible, no login may be required.

The most robust fix is to refactor all affected queries to use prepared statements with bound parameters, combined with strict validation for ID fields so only well-formed values are accepted.

Establish a coding standard that forbids string-concatenated SQL, employ parameterized queries by default, validate all externally supplied data against expected formats, and integrate automated security checks into the development and review process.

Find out what's already
exploitable in your codebase.