/

CVE-2026-36948

Severity:

HIGH RISK

(7.3)

SQL Injection in Sourcecodester Online Thesis Archiving

CVE-2026-36948

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Data Exposure and Manipulation 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

Sourcecodester Online Thesis Archiving System v1.0 contains a SQL injection vulnerability in /otas/view_archive.php that allows crafted input to be interpreted as part of a database query.

If user-controlled parameters are not properly sanitized, an attacker can manipulate queries to access, modify, or delete thesis records and related data.

Affected context

This vulnerability appears in the web application layer of the Online Thesis Archiving System, specifically when retrieving archive records through /otas/view_archive.php.

It is typically exposed when user-supplied input (for example, query string or form parameters) is concatenated directly into SQL statements for viewing thesis archive details.

The issue is most relevant in deployments where database accounts have broad privileges and where no additional query-layer protections (such as parameterization or strong input validation) are enforced.

Exploit preconditions

  • Attack surface: Public or internal web interface, via HTTP requests sent to /otas/view_archive.php
  • Required access: Ability to send crafted requests to the affected endpoint (often unauthenticated or low-privilege user context, depending on configuration)
  • Trigger point: Parameters consumed by view_archive.php that influence SQL queries used to retrieve thesis archive data
  • Why exploitation is possible: The application constructs SQL statements by directly embedding untrusted input, allowing injection of arbitrary SQL fragments that the database executes

Why this happens

The root cause is the use of dynamically constructed SQL queries that interpolate user-controlled values without proper parameterization or escaping.

This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where metacharacters such as quotes, operators, or comment markers are not neutralized before being passed to the database.

At an abstract level, the bug class is "string concatenation for queries" instead of using prepared statements with bound parameters, making the query structure partially controllable by the attacker.

Potential impact

  • Access to thesis archive records that the attacker should not be able to read
  • Modification or deletion of existing thesis entries and related metadata
  • Insertion of malicious or fraudulent records into the archive
  • Enumeration of database schema information (tables, columns, users)
  • Potential compromise of other application data stored in the same database, depending on schema and permissions

General mitigation guidance

Effective mitigation focuses on eliminating direct string-based query construction and tightening data access boundaries:

  • Use parameterized queries or prepared statements for all database interactions, especially in view_archive.php and similar endpoints
  • Apply strict server-side validation and normalization of all input that influences SQL, limiting values to expected formats and types (e.g., numeric IDs, fixed enums)
  • Encapsulate database access in a data access layer that prohibits raw query concatenation by default
  • Restrict database account privileges to the minimum required for the application's functions, avoiding powerful roles for routine web queries
  • Implement defense-in-depth controls such as application-layer error handling that avoids exposing raw SQL or stack traces

How teams detect issues like this

Detection typically combines code-level and traffic-level analysis:

  • Use static analysis rules or SAST tools to flag SQL query construction that concatenates $_GET/$_POST/$_REQUEST or other user inputs
  • During code review, look for raw SQL strings built with string interpolation, concatenation operators, or untyped variable embedding in view_archive.php and related modules
  • Enforce secure coding guidelines and automated CI checks that require parameterized queries for all new or changed database access code
  • Monitor application logs and database logs for anomalous query patterns, such as unexpected use of SQL keywords (UNION, OR 1=1, comments) in parameters

Sources

SourceLink
github.comgithub.com/huliangjia/bug_report/blob/main/Sourcecodester/online-thesis-archiving-system/SQL-1.md

Frequently asked

questions

Yes. As long as the /otas/view_archive.php endpoint is reachable over the network, an attacker can attempt SQL injection by sending crafted HTTP requests.

Not necessarily. Exploitation may be possible without authentication if the affected endpoint is exposed to unauthenticated users; if not, any low-privileged account with access to the page could be sufficient.

Replace all string-concatenated SQL in view_archive.php with parameterized queries or prepared statements, combined with strict server-side validation of input types and ranges, and ensure the database user has only minimal privileges.

Adopt a standard data access layer that only exposes parameterized operations, enforce secure coding standards via code review and automated checks, and train developers to treat all external input as untrusted and subject to validation before it reaches the database.

Find out what's already
exploitable in your codebase.