Severity:

HIGH RISK

(7.3)

SQL Injection in PHPGurukul Online Course Registration 3.1

CVE-2026-5814

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Unauthorized Data Access and Modification

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

PHPGurukul Online Course Registration 3.1 is vulnerable to SQL injection through the regno parameter in /admin/check_availability.php.

A remote attacker can manipulate this parameter to inject arbitrary SQL queries, potentially leading to unauthorized data access or modification when the application concatenates user input into database queries.

Affected context

The vulnerability occurs in the admin-side script /admin/check_availability.php when it processes the regno request parameter as part of a database query.

It manifests in deployments where user-controlled input is interpolated directly into SQL statements without robust validation, type enforcement, or parameterization.

This typically affects any instance where administrative or course registration lookups depend on the regno value provided via HTTP requests.

Exploit preconditions

  • Attack surface: HTTP interface to /admin/check_availability.php
  • Required access: Ability to send crafted HTTP requests to the affected endpoint (e.g., access to the admin panel endpoint if not properly restricted)
  • Trigger point: Submission of a malicious regno value that is concatenated into a SQL query
  • Why exploitation is possible: The application builds SQL statements using untrusted input from regno without using prepared statements or adequate escaping, allowing injected fragments to alter query structure or logic

Why this happens

The underlying bug class is SQL injection, aligning with CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

The code likely constructs SQL queries by string-concatenating the regno parameter directly into the query text, treating user-provided data as part of the command rather than as data.

Additionally, this reflects CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because untrusted input destined for the database layer is not sanitized for that context.

The absence of parameterized queries, strict input typing, and central query-building patterns enables attackers to influence how the database interprets the final SQL statement.

Potential impact

  • May allow retrieval of sensitive information from course registration or user tables
  • Could enable modification or deletion of registration records or related data
  • Can allow the creation of new administrative or user accounts if the schema permits
  • May be used to bypass authentication or authorization checks tied to database lookups
  • Could facilitate further compromise of the application if database access is leveraged to extract configuration or credential data

General mitigation guidance

Effective mitigation focuses on treating all externally supplied values as data, never as query syntax.

Recommended defensive patterns include:

  • Using parameterized queries / prepared statements for all database operations involving external input
  • Enforcing strict validation and type constraints on regno (e.g., numeric or fixed-format identifiers) before using it in database logic
  • Centralizing database access in a data access layer that disallows raw string-built queries
  • Applying least-privilege to database accounts so that the application can only perform necessary operations
  • Normalizing and reducing the surface of admin endpoints, ensuring they do not accept unnecessary parameters or query constructions

How teams detect issues like this

Detection efforts can combine code-centric review with runtime monitoring:

  • Static analysis rules that flag string-concatenated SQL queries and direct use of request parameters inside SQL statements
  • Manual code review focusing on all uses of $_GET, $_POST, or similar superglobals in query construction, especially in admin scripts like check_availability.php
  • Central logging of database errors and anomalous query patterns that may indicate attempted injection (e.g., unexpected operators or keywords in parameter values)
  • Policy checks in CI/CD pipelines that enforce use of prepared statements and prohibit ad-hoc query construction in web handlers

Automated security scanners and SAST tools can assist by identifying SQL injection patterns early in development or during periodic audits.

Sources

SourceLink
github.comgithub.com/f1rstb100d/CVE/issues/21
phpgurukul.comphpgurukul.com/
vuldb.comvuldb.com/submit/787698
vuldb.comvuldb.com/vuln/356262
vuldb.comvuldb.com/vuln/356262/cti

Frequently asked

questions

Yes. An attacker can exploit it remotely by sending crafted HTTP requests to /admin/check_availability.php, assuming the endpoint is reachable over the network.

That depends on how the application is deployed. If the admin directory is not protected or is weakly protected, attackers may reach the vulnerable script unauthenticated. If strong access controls are in place, an attacker may first need valid credentials or another weakness to reach the endpoint.

The most robust fix is to refactor the affected queries to use prepared statements with bound parameters and enforce strict validation on regno so it conforms to an expected, constrained format.

Adopting a security-by-default data access layer that only allows parameterized queries, enforcing secure coding guidelines for database access, adding automated checks in the development pipeline, and regularly reviewing endpoints that consume user input are effective long-term prevention strategies.

Find out what's already
exploitable in your codebase.