/

CVE-2025-51567

Severity:

CRITICAL RISK

(9.1)

SQL Injection in kashipara Online Exam System Profile

CVE-2025-51567

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Command Execution and Unauthorized Database Access

Severity:

CRITICAL RISK

(9.1)

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 /exam/user/profile.php page of the kashipara Online Exam System V1.0 allows crafted input in several profile fields to be interpreted directly as SQL.

When exploited, this can let a remote attacker execute arbitrary SQL commands, potentially gaining unauthorized access to sensitive exam and user data through the vulnerable POST parameters.

Affected context

The vulnerability occurs in the user profile functionality of the kashipara Online Exam System V1.0 at /exam/user/profile.php.

It specifically affects deployments where:

  • User-supplied POST parameters (rname, rcollage, rnumber, rgender, rpassword) are concatenated into SQL statements.
  • The underlying database calls are made without prepared statements or robust input validation.
  • Application and database are reachable over the network, exposing the profile update endpoint to remote users or internet-facing traffic.

Exploit preconditions

  • Attack surface: HTTP POST requests to /exam/user/profile.php.
  • Required access: Ability to submit or intercept profile update requests (e.g., authenticated user session or exposed endpoint).
  • Trigger point: Processing of the rname, rcollage, rnumber, rgender, or rpassword parameters in server-side SQL queries.
  • Why exploitation is possible: The application incorporates raw parameter values into SQL without proper parameterization, escaping, or query abstraction, allowing attacker-controlled input to change the structure of the query.

Why this happens

This issue arises from constructing SQL statements by directly concatenating user-controlled data into query strings.

Instead of using parameterized queries or an ORM that separates code from data, the application likely embeds values from rname, rcollage, rnumber, rgender, and rpassword directly into SQL.

This pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where untrusted input is not correctly handled before being passed to the database engine.

Potential impact

  • An attacker may retrieve sensitive information such as user details, exam records, and credential data stored in the database.
  • An attacker could modify or delete records, impacting exam results, user accounts, or configuration data.
  • An attacker might create or escalate user accounts, potentially gaining administrative access within the application.
  • In some configurations, the attacker can execute database-specific functions that may lead to remote code execution at the database or host level.

General mitigation guidance

Effective mitigation focuses on separating SQL logic from user data and reducing trust in all incoming parameters:

  • Use parameterized queries (prepared statements) for all database interactions, binding user input as data rather than composing it into SQL strings.
  • Adopt a database abstraction layer or ORM that enforces query parameterization and discourages raw string-based SQL.
  • Apply strict server-side validation and normalization for profile fields (name, college, number, gender, password) based on expected formats and lengths, rejecting unexpected patterns instead of attempting to sanitize them.
  • Limit database permissions for the application account to only the operations it genuinely needs, reducing impact if injection occurs.
  • Centralize database access patterns so query construction is standardized and easier to review for unsafe string concatenation.

How teams detect issues like this

Detection commonly combines code-level inspection with behavioral monitoring:

  • Static analysis: Configure security linters or SAST tools to flag string concatenation in SQL query construction and direct use of request parameters in database calls.
  • Code review signals: Look for inline SQL built with interpolation (e.g., string concatenation with POST parameters) in PHP code, especially around profile update logic and other form handlers.
  • Runtime monitoring: Use database logging or a web application firewall (WAF) to observe anomalous query patterns, such as queries with injected control characters or always-true conditions in WHERE clauses.
  • Security testing: Incorporate automated and manual SQL injection tests into CI/CD or periodic security assessments, focusing on POST endpoints that modify user data.

Sources

SourceLink
github.comgithub.com/0xBhushan/Writeups/blob/main/CVE/Kashipara/Online%20Exam%20System/SQL%20Injection-Profile%20Update.pdf

Frequently asked

questions

Yes. Any remote attacker who can reach the /exam/user/profile.php endpoint and send crafted POST requests may be able to exploit the SQL injection, subject to authentication and deployment configuration.

In many deployments, updating a profile requires a logged-in user session. However, exploitability ultimately depends on how access control is implemented; if the endpoint is misconfigured or reused elsewhere, an unauthenticated attacker might reach it.

The most robust fix is to replace all string-built SQL with parameterized queries or ORM-based data access, ensuring user input is always bound as parameters and never directly concatenated into SQL statements.

Establish a development standard that forbids raw SQL string concatenation with user input, enforce it via code review and static analysis tools, and provide developers with secure data access primitives (prepared statements, ORMs) as the default way to interact with the database.

Find out what's already
exploitable in your codebase.