/

CVE-2026-14732

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in Exam Editing Endpoint

CVE-2026-14732

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Data Exposure and Tampering via SQL Injection

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 flaw in the /edit_exam.php endpoint of SourceCodester Class and Exam Timetabling System 1.0 allows an attacker to manipulate the ID parameter and inject arbitrary SQL commands into backend queries.

When user-supplied identifiers are concatenated directly into SQL statements without proper validation or parameterization, remote attackers can exploit the application over HTTP to access or tamper with stored exam data.

Affected context

This vulnerability occurs in the web-based Class and Exam Timetabling System, specifically within the PHP script handling exam editing (/edit_exam.php).

It typically manifests when the application constructs SQL queries using the ID request parameter directly in the query string, without using prepared statements or rigorous validation.

Installations exposed to the internet or untrusted internal networks, where the edit exam functionality is reachable without strong access controls, are more likely to be affected.

Exploit preconditions

  • Attack surface: HTTP interface of the /edit_exam.php endpoint.
  • Required access: Ability to send crafted requests to the exam editing page; authentication requirements depend on deployment and role-based access controls.
  • Trigger point: Application code that builds SQL queries using the ID argument from GET or POST parameters without parameterization.
  • Why exploitation is possible: The ID parameter is treated as trusted input and concatenated into SQL statements, enabling attackers to alter query structure instead of just data values.

Why this happens

The root cause is insecure construction of SQL queries in PHP code, where dynamic user input (the ID parameter) is interpolated into query strings without binding through prepared statements or rigorous sanitization.

This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), and is related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because the database is treated as a downstream consumer of unneutralized data.

At an abstract level, the pattern is: accepting untrusted input, failing to constrain it to an expected format (such as numeric IDs), and passing it directly into command-like contexts where metacharacters change control flow.

Potential impact

  • Attackers may read exam records and associated class scheduling data they would not normally be authorized to access.
  • Malicious users could modify, insert, or delete exam entries, corrupting timetables and operational data.
  • The vulnerability may allow extraction of sensitive information stored in the same database, depending on schema and permissions.
  • Under permissive database configurations, attackers could create new administrative accounts or adjust authentication-related data.
  • In some deployments, SQL injection could be chained to execute database-specific functions that impact system stability or availability.

General mitigation guidance

Effective mitigation focuses on eliminating direct concatenation of user input into SQL queries and tightening trust boundaries around request parameters.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations, ensuring that user input is treated strictly as data.
  • Constraining the ID parameter to a well-defined type (e.g., integer) and validating it server-side before it reaches the data-access layer.
  • Centralizing database access logic to enforce consistent query construction practices and input validation rules.
  • Applying least-privilege principles to database accounts so that even if a query is abused, accessible operations and data are minimized.
  • Adopting secure-by-default frameworks or ORM layers that discourage manual string-based query building.

How teams detect issues like this

Detection can rely on a combination of code-centric and behavior-centric approaches:

  • Static analysis rules that flag concatenation of request parameters (e.g., $_GET, $_POST) into SQL strings or calls to database APIs without bound parameters.
  • Targeted code review focusing on PHP scripts that handle editing or viewing operations, looking for direct interpolation of variables like ID into SQL.
  • Runtime monitoring and logging to identify anomalous query patterns, such as unexpected operators, comment markers, or tautological conditions in WHERE clauses.
  • Security testing routines (including automated web scanners) configured to exercise form fields and URL parameters associated with exam and class management functionality.
  • Policy enforcement in CI pipelines that disallow direct string-based SQL construction, backed by automated checks against database access layers.

Sources

SourceLink
github.comgithub.com/cyberdrinclj/pcve/issues/1
vuldb.comvuldb.com/cve/CVE-2026-14732
vuldb.comvuldb.com/submit/847956
vuldb.comvuldb.com/vuln/376314
vuldb.comvuldb.com/vuln/376314/cti
sourcecodester.comsourcecodester.com/

Frequently asked

questions

Yes, if the /edit_exam.php endpoint is exposed to the internet or reachable from untrusted networks, an attacker can issue crafted HTTP requests to attempt SQL injection through the ID parameter.

That depends on how the application is deployed. In some configurations, the edit exam page may require login or particular roles; in others, it might be more broadly accessible. The key requirement is the ability to interact with the vulnerable parameter.

The most robust fix is to refactor all affected queries to use prepared statements or ORM constructs that bind parameters, combined with strict server-side validation of identifiers and removal of any dynamic query-building based on raw user input.

Establish a standard of using parameterized queries exclusively, add automated checks that flag direct concatenation of input into SQL, and train developers to treat all external data as untrusted, validating and constraining it before it reaches any command or query interfaces.

Find out what's already
exploitable in your codebase.