/

CVE-2026-16154

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in SourceCodester Timetabling

CVE-2026-16154

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Data Exposure and Database Compromise

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

A SQL injection vulnerability in the SourceCodester Class and Exam Timetabling System allows an attacker to manipulate the ID parameter in /edit_room1.php to influence database queries.

When reachable over the network and not properly sanitized, this flaw can be exploited remotely to access, modify, or destroy application data and potentially escalate privileges.

A SQL injection vulnerability in the SourceCodester Class and Exam Timetabling System allows an attacker to manipulate the ID parameter in /edit_room1.php to influence database queries.

When reachable over the network and not properly sanitized, this flaw can be exploited remotely to access, modify, or destroy application data and potentially escalate privileges.

Affected context

This vulnerability occurs in web deployments of the SourceCodester Class and Exam Timetabling System where the /edit_room1.php endpoint is exposed to users and processes input from the ID parameter to build SQL queries.

It becomes risky when user-supplied data is concatenated directly into SQL statements without robust validation, encoding, or parameterization, particularly in environments where database accounts have broad privileges.

This vulnerability occurs in web deployments of the SourceCodester Class and Exam Timetabling System where the /edit_room1.php endpoint is exposed to users and processes input from the ID parameter to build SQL queries.

It becomes risky when user-supplied data is concatenated directly into SQL statements without robust validation, encoding, or parameterization, particularly in environments where database accounts have broad privileges.

Exploit preconditions

  • Attack surface: HTTP interface to /edit_room1.php in the timetabling system
  • Required access: Ability to send crafted requests with controlled ID parameter values (typically as an authenticated or unauthenticated web user, depending on deployment)
  • Trigger point: Server-side processing of the ID argument when constructing and executing SQL statements
  • Why exploitation is possible: The application appears to interpolate raw request parameters into SQL queries without using parameterized statements or adequate input handling, allowing an attacker to alter query structure
  • Attack surface: HTTP interface to /edit_room1.php in the timetabling system
  • Required access: Ability to send crafted requests with controlled ID parameter values (typically as an authenticated or unauthenticated web user, depending on deployment)
  • Trigger point: Server-side processing of the ID argument when constructing and executing SQL statements
  • Why exploitation is possible: The application appears to interpolate raw request parameters into SQL queries without using parameterized statements or adequate input handling, allowing an attacker to alter query structure

Why this happens

The underlying issue maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), and is also related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component.

In this case, user-provided data in the ID parameter is treated as trusted and incorporated directly into a SQL command string destined for the database engine.

Without parameterization or careful neutralization of control characters and query syntax, the database interprets attacker-controlled input as part of the executable query logic, breaking the intended query boundary and enabling arbitrary SQL behavior.

The underlying issue maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), and is also related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component.

In this case, user-provided data in the ID parameter is treated as trusted and incorporated directly into a SQL command string destined for the database engine.

Without parameterization or careful neutralization of control characters and query syntax, the database interprets attacker-controlled input as part of the executable query logic, breaking the intended query boundary and enabling arbitrary SQL behavior.

Potential impact

  • Attackers may read sensitive timetabling and user-related data from the database.
  • Malicious users could modify or delete class and exam schedules, rooms, and related records.
  • Data integrity could be compromised, leading to inconsistent or fraudulent timetabling information.
  • Under certain configurations, attackers can escalate privileges or pivot to other parts of the application using database-level access.
  • In permissive database environments, this may enable creation of new accounts or extraction of credentials stored in the database.
  • Attackers may read sensitive timetabling and user-related data from the database.
  • Malicious users could modify or delete class and exam schedules, rooms, and related records.
  • Data integrity could be compromised, leading to inconsistent or fraudulent timetabling information.
  • Under certain configurations, attackers can escalate privileges or pivot to other parts of the application using database-level access.
  • In permissive database environments, this may enable creation of new accounts or extraction of credentials stored in the database.

General mitigation guidance

Effective mitigation focuses on eliminating direct string concatenation for SQL queries and reducing trust in user-controlled inputs.

General defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations involving external input.
  • Applying strict server-side validation on the ID parameter, enforcing allowed formats (e.g., numeric or constrained identifiers) before it reaches the data access layer.
  • Centralizing query construction to a well-reviewed data access component rather than building SQL inline in presentation logic.
  • Restricting database account privileges so that the application can only perform necessary operations, limiting damage if an injection occurs.
  • Applying output encoding or structured binding when passing data to downstream components such as the database engine.

Effective mitigation focuses on eliminating direct string concatenation for SQL queries and reducing trust in user-controlled inputs.

General defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations involving external input.
  • Applying strict server-side validation on the ID parameter, enforcing allowed formats (e.g., numeric or constrained identifiers) before it reaches the data access layer.
  • Centralizing query construction to a well-reviewed data access component rather than building SQL inline in presentation logic.
  • Restricting database account privileges so that the application can only perform necessary operations, limiting damage if an injection occurs.
  • Applying output encoding or structured binding when passing data to downstream components such as the database engine.

How teams detect issues like this

High-level detection approaches include:

  • Static analysis rules that flag dynamic SQL construction using concatenated request parameters (e.g., variables derived from $_GET or $_POST).
  • Code review checklists that require verification of parameterized queries and explicit validation of user input for database access paths.
  • Logging and monitoring of unusual query patterns, such as queries containing typical injection signatures or unexpected UNION or subselect constructs.
  • Enforcing secure coding policies in the development workflow, backed by automated tools that highlight non-parameterized SQL usage and direct interpolation of user data.

High-level detection approaches include:

  • Static analysis rules that flag dynamic SQL construction using concatenated request parameters (e.g., variables derived from $_GET or $_POST).
  • Code review checklists that require verification of parameterized queries and explicit validation of user input for database access paths.
  • Logging and monitoring of unusual query patterns, such as queries containing typical injection signatures or unexpected UNION or subselect constructs.
  • Enforcing secure coding policies in the development workflow, backed by automated tools that highlight non-parameterized SQL usage and direct interpolation of user data.

Sources

SourceLink
github.comgithub.com/justconter/cve/issues/5
vuldb.comvuldb.com/cve/CVE-2026-16154
vuldb.comvuldb.com/submit/857079
vuldb.comvuldb.com/vuln/379919
vuldb.comvuldb.com/vuln/379919/cti
sourcecodester.comsourcecodester.com/

Frequently asked

questions

Exploitability depends on how widely /edit_room1.php is exposed and whether access is gated by authentication.

In many typical deployments, an attacker who can reach the web interface and control the ID parameter may remotely exploit the flaw.

At minimum, an attacker needs network access to the web application and the ability to send crafted requests.

Whether they must be logged in depends on deployment-specific access controls around the vulnerable endpoint.

The safest fix is to refactor all affected queries to use parameterized statements and prepared queries, combined with strict validation of the ID parameter and removal of direct string concatenation for SQL.

Reducing database privileges for the application account further limits impact.

Adopt a standard data access layer that enforces parameterization by default, include input validation and encoding requirements in coding guidelines, and integrate static analysis or code scanning into CI pipelines to flag any non-parameterized or dynamically built SQL constructs.

Exploitability depends on how widely /edit_room1.php is exposed and whether access is gated by authentication.

In many typical deployments, an attacker who can reach the web interface and control the ID parameter may remotely exploit the flaw.

At minimum, an attacker needs network access to the web application and the ability to send crafted requests.

Whether they must be logged in depends on deployment-specific access controls around the vulnerable endpoint.

The safest fix is to refactor all affected queries to use parameterized statements and prepared queries, combined with strict validation of the ID parameter and removal of direct string concatenation for SQL.

Reducing database privileges for the application account further limits impact.

Adopt a standard data access layer that enforces parameterization by default, include input validation and encoding requirements in coding guidelines, and integrate static analysis or code scanning into CI pipelines to flag any non-parameterized or dynamically built SQL constructs.

Find out what's already
exploitable in your codebase.