/

CVE-2020-37057

Severity:

HIGH RISK

(8.2)

SQL Injection in Online-Exam-System Feedback Module

CVE-2020-37057

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Data Exposure and Manipulation via SQL Injection

Severity:

HIGH RISK

(8.2)

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 Online-Exam-System 2015 feedback module allows attacker-controlled input in the fid parameter to be incorporated directly into SQL queries.

Under typical deployments where the application connects to the exam database with broad privileges, an attacker could craft malicious requests to read, modify, or delete data managed by the system.

Affected context

The vulnerability occurs in the feedback module of Online-Exam-System 2015 where HTTP requests carrying an fid parameter are translated into database queries.

It is relevant in deployments where:

  • The fid parameter is accepted from user-controlled input (e.g., query string or form data)
  • That value is concatenated into SQL statements without robust validation or parameterization
  • The application account has access to exam-related tables, user records, or other sensitive data

In such contexts, any user or attacker capable of sending crafted requests to the feedback endpoint may be able to influence backend SQL execution.

Exploit preconditions

  • Attack surface: Web application HTTP interface (feedback functionality)
  • Required access: Ability to send HTTP requests to the Online-Exam-System 2015 feedback module (often anonymous or low-privileged access)
  • Trigger point: Processing of the fid parameter in server-side code that builds and executes SQL queries
  • Why exploitation is possible: The fid parameter is incorporated into SQL commands without proper parameterization or sufficient input validation, allowing attacker-controlled tokens to alter the structure and logic of the query.

Why this happens

This issue stems from building SQL queries by concatenating raw, user-supplied input from the fid parameter directly into query strings.

When application code uses string interpolation or concatenation (e.g., "SELECT ... WHERE fid=" + fid) instead of parameterized queries or prepared statements, user input is treated as part of the SQL syntax rather than as data.

This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the boundary between user data and SQL control tokens is not enforced.

Potential impact

  • Attackers may extract sensitive data from exam, user, or configuration tables.
  • Attackers could modify or delete exam results, questions, or user accounts.
  • Attackers might create or escalate their own accounts by manipulating authentication-related records.
  • In some configurations, attackers could execute stacked queries leading to broader database or host compromise.

General mitigation guidance

Effective mitigation typically focuses on strictly separating user input from SQL command structure and reducing the trust placed in web-facing parameters:

  • Use parameterized queries or prepared statements for all database access involving the fid parameter and other user-controlled values.
  • Apply server-side validation and normalization on identifiers and numeric fields, ensuring they conform to expected formats and ranges before database use.
  • Limit database privileges of the application account to only the operations and tables strictly required for the feedback functionality.
  • Introduce centralized database access layers or ORM abstractions that default to safe query-building patterns and minimize ad hoc string-based SQL.
  • Implement defense-in-depth controls such as application-level error handling that avoids exposing raw SQL errors and schema details.

How teams detect issues like this

Detection can combine static analysis, code review, and runtime monitoring:

  • Configure static analysis tools or linters to flag dynamic SQL construction patterns, especially concatenation or interpolation of $_GET, $_POST, or other request parameters into query strings.
  • During code review, look for direct string-building of SQL in the feedback module and ensure every query uses bound parameters instead of raw concatenation.
  • Employ database activity monitoring (DAM) or logging to detect anomalous queries containing SQL injection signatures, unexpected keywords, or multi-statement execution originating from the feedback endpoint.
  • Integrate security testing into CI/CD, including automated SQL injection tests against routes that consume the fid parameter.

Sources

SourceLink
github.comgithub.com/sunnygkp10/Online-Exam-System-.git
exploit-db.comexploit-db.com/exploits/48529
vulncheck.comvulncheck.com/advisories/online-exam-system-fid-sql-injection

Frequently asked

questions

Yes. As long as the feedback module is accessible over the network, an attacker can remotely send crafted requests containing malicious fid values.

Typically, only the ability to reach the feedback endpoint and supply an fid parameter is required; no elevated privileges are needed if the route is publicly or low-privilege accessible.

Refactor all affected database interactions to use parameterized queries or prepared statements, removing any direct concatenation of user input into SQL, and reduce database privileges to least necessary.

Adopt secure database access patterns (prepared statements by default), enforce input validation, incorporate security-focused code reviews and automated static analysis, and establish development guidelines that prohibit dynamic SQL built from unsanitized user input.

Find out what's already
exploitable in your codebase.