/

CVE-2026-13487

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in Class Exam Timetabling App

CVE-2026-13487

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 Class and Exam Timetabling System allows crafted input in the sy parameter of archive.php to alter backend database queries.

When user-controlled data is concatenated directly into SQL statements without proper sanitization, remote attackers can read or modify sensitive application data.

A SQL injection vulnerability in the Class and Exam Timetabling System allows crafted input in the sy parameter of archive.php to alter backend database queries.

When user-controlled data is concatenated directly into SQL statements without proper sanitization, remote attackers can read or modify sensitive application data.

Affected context

This vulnerability occurs in deployments of the SourceCodester Class and Exam Timetabling System where the /archive.php endpoint accepts the sy parameter from HTTP requests and uses it in database queries.

It typically manifests when application input is interpolated into SQL strings instead of being passed through parameterized queries or robust filtering logic.

The risk is elevated on internet-exposed instances or where the application is reachable by untrusted users, especially if the database user has broad privileges.

This vulnerability occurs in deployments of the SourceCodester Class and Exam Timetabling System where the /archive.php endpoint accepts the sy parameter from HTTP requests and uses it in database queries.

It typically manifests when application input is interpolated into SQL strings instead of being passed through parameterized queries or robust filtering logic.

The risk is elevated on internet-exposed instances or where the application is reachable by untrusted users, especially if the database user has broad privileges.

Exploit preconditions

  • Attack surface: HTTP requests to the /archive.php script in the Class and Exam Timetabling System.
  • Required access: Network-level access to the web application (e.g., browser or automated client).
  • Trigger point: Submission of a crafted sy parameter value that is processed by database-related logic in archive.php.
  • Why exploitation is possible: The sy value is incorporated directly into SQL statements without sufficient neutralization or use of parameterized queries, allowing attacker-controlled syntax to change the query's structure.
  • Attack surface: HTTP requests to the /archive.php script in the Class and Exam Timetabling System.
  • Required access: Network-level access to the web application (e.g., browser or automated client).
  • Trigger point: Submission of a crafted sy parameter value that is processed by database-related logic in archive.php.
  • Why exploitation is possible: The sy value is incorporated directly into SQL statements without sufficient neutralization or use of parameterized queries, allowing attacker-controlled syntax to change the query's structure.

Why this happens

The root cause 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 where query construction is treated as dynamic string output.

Instead of using prepared statements or parameter binding, the application appears to build SQL commands by concatenating raw request parameters such as sy into query strings.

This insecure pattern allows input data to be interpreted as SQL control characters and keywords, transforming otherwise benign queries into arbitrary commands executed by the database engine.

The root cause 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 where query construction is treated as dynamic string output.

Instead of using prepared statements or parameter binding, the application appears to build SQL commands by concatenating raw request parameters such as sy into query strings.

This insecure pattern allows input data to be interpreted as SQL control characters and keywords, transforming otherwise benign queries into arbitrary commands executed by the database engine.

Potential impact

  • Attackers may read sensitive information from timetabling and user-related tables.
  • Attackers could modify or delete exam schedules, class records, and related data.
  • Attackers may create or escalate application accounts if authentication data is stored in the same database.
  • Attackers could attempt database-level privilege escalation or pivot to other systems, depending on database permissions and configuration.
  • Attackers may read sensitive information from timetabling and user-related tables.
  • Attackers could modify or delete exam schedules, class records, and related data.
  • Attackers may create or escalate application accounts if authentication data is stored in the same database.
  • Attackers could attempt database-level privilege escalation or pivot to other systems, depending on database permissions and configuration.

General mitigation guidance

Effective mitigation focuses on eliminating direct string-based query construction and reducing trust in incoming parameters.

Secure patterns typically include:

  • Using parameterized queries or prepared statements for all database interactions, ensuring user input is treated strictly as data.
  • Implementing strict server-side validation and whitelisting for inputs like sy, restricting values to expected formats (e.g., numeric IDs or known school year codes).
  • Applying least-privilege principles to the database user account so that even if a query is abused, the scope of damage is constrained.
  • Centralizing data access logic so that query construction is easier to audit and can follow consistent secure coding standards.
  • Avoiding dynamic SQL string concatenation and template-based query assembly wherever possible.

Effective mitigation focuses on eliminating direct string-based query construction and reducing trust in incoming parameters.

Secure patterns typically include:

  • Using parameterized queries or prepared statements for all database interactions, ensuring user input is treated strictly as data.
  • Implementing strict server-side validation and whitelisting for inputs like sy, restricting values to expected formats (e.g., numeric IDs or known school year codes).
  • Applying least-privilege principles to the database user account so that even if a query is abused, the scope of damage is constrained.
  • Centralizing data access logic so that query construction is easier to audit and can follow consistent secure coding standards.
  • Avoiding dynamic SQL string concatenation and template-based query assembly wherever possible.

How teams detect issues like this

Detection often combines automated and manual review techniques:

  • Static analysis rules that flag dynamic SQL construction using untrusted input, particularly variables sourced from HTTP request parameters.
  • Code review practices that examine database access layers for concatenated query strings and missing input validation or encoding.
  • Runtime security testing (e.g., DAST) that sends crafted payloads to parameters like sy and monitors for SQL error messages or anomalous responses.
  • Centralized logging and monitoring of database queries and application errors to identify suspicious patterns indicative of injection attempts.
  • Incorporating secure coding policies that prohibit raw SQL concatenation and require prepared statements as a default.

Detection often combines automated and manual review techniques:

  • Static analysis rules that flag dynamic SQL construction using untrusted input, particularly variables sourced from HTTP request parameters.
  • Code review practices that examine database access layers for concatenated query strings and missing input validation or encoding.
  • Runtime security testing (e.g., DAST) that sends crafted payloads to parameters like sy and monitors for SQL error messages or anomalous responses.
  • Centralized logging and monitoring of database queries and application errors to identify suspicious patterns indicative of injection attempts.
  • Incorporating secure coding policies that prohibit raw SQL concatenation and require prepared statements as a default.

Sources

SourceLink
github.comgithub.com/lffaker/cybersec/issues/4
vuldb.comvuldb.com/cve/CVE-2026-13487
vuldb.comvuldb.com/submit/838189
vuldb.comvuldb.com/vuln/374484
vuldb.comvuldb.com/vuln/374484/cti
sourcecodester.comsourcecodester.com/

Frequently asked

questions

Yes. An attacker with network access to the web application can send crafted requests to /archive.php and exploit the sy parameter, without needing local server access.

Only the ability to reach the vulnerable endpoint over HTTP or HTTPS is typically required. No prior authentication may be necessary, depending on how the application is configured.

Refactor all affected queries to use parameterized statements, then enforce strict validation and whitelisting on the sy parameter so that only expected, well-formed values are accepted.

Adopt secure coding standards that mandate prepared statements for every database call, integrate static and dynamic security testing into the development pipeline, and ensure developers are trained to treat all external input as untrusted by default.

Yes. An attacker with network access to the web application can send crafted requests to /archive.php and exploit the sy parameter, without needing local server access.

Only the ability to reach the vulnerable endpoint over HTTP or HTTPS is typically required. No prior authentication may be necessary, depending on how the application is configured.

Refactor all affected queries to use parameterized statements, then enforce strict validation and whitelisting on the sy parameter so that only expected, well-formed values are accepted.

Adopt secure coding standards that mandate prepared statements for every database call, integrate static and dynamic security testing into the development pipeline, and ensure developers are trained to treat all external input as untrusted by default.

Find out what's already
exploitable in your codebase.