Skip to content
Online Examination System Issues 5

Online Examination System Issues 5

github.com • October 18, 2026

SQL injection in admin data endpoints (qsdb/usersdb/brandb/topicsdb/subjectsdb.php) allows unauthenticated database extraction

The five flexigrid data endpoints under admin/ concatenate the POST parameters query , qtype , sortname and sortorder into SQL statements without escaping, and they require no authentication. A UNION-based payload in qtype returns arbitrary rows of any table - demonstrated here by extracting the users table including password hashes and user levels - directly in the JSON response.

Commit: e6208e630b14657999bbfe4c9912302d2a1e2449 (master)

SQL Injection (CWE-89)

The parameters are used to assemble the WHERE ( $qtype , $query ) and ORDER BY ( $sortname , $sortorder ) clauses of the query through plain string concatenation. None of the values is escaped, quoted, whitelisted or cast, and the endpoints have no authentication check, so the injection is reachable by anyone on the network.

Deploy the application at a test host ( in this reproduction) per readme.txt . The application targets PHP 5.x (uses the mysql_* extension in these endpoints); this reproduction runs PHP 7.4 with a minimal compatibility layer that only re-provides the removed builtins - application code is not modified.

Send the UNION payload in qtype (the trailing -- out the remainder of the generated query) with no cookies at all:

Observed output (last two rows are the injected users rows - username, MD5 password, email, user level):

( total is blank because the same injected UNION is also applied to the SELECT count(q_id) ... pagination query, whose 1 column does not match the 8 columns of the injected SELECT - MySQL error 1222 - which does not affect the main query used for the rows.)

The same injection class works through sortname / sortorder and in the other four endpoints (e.g. usersdb.php with its 6-column SELECT).

Unauthenticated, in-band SQL injection: an attacker can read any table of the application database (credentials hashes, user emails, exam results, question bank) directly from the HTTP response.

The database user configured in include/constants.php is root by default, so the injected statements run with maximum database privileges (limited in practice by the filesystem permissions and the DB configuration).

CVSS Score (self-assessed)

CVSS 3.1: 7.5 High - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Network vector, low complexity, no privileges or interaction; the flaw yields high confidentiality impact (arbitrary SELECT data extraction). No integrity or availability impact was demonstrated with the default configuration.

Extracted Entities

Attack Types (1)

CWE Weaknesses (1)

Platforms (2)