/

CVE-2025-67146

Severity:

CRITICAL RISK

(9.4)

SQL Injection in GYM-MANAGEMENT-SYSTEM Search and Payment

CVE-2025-67146

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authentication Bypass and Data Compromise via SQL Injection

Severity:

CRITICAL RISK

(9.4)

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

Multiple SQL injection vulnerabilities in GYM-MANAGEMENT-SYSTEM 1.0 allow untrusted input from the name and id parameters to be used directly in database queries.

An unauthenticated remote attacker sending crafted requests to search and payment endpoints can manipulate SQL statements, potentially extracting sensitive data, bypassing authentication, or altering database contents.

Affected context

The vulnerability occurs in the web-based GYM-MANAGEMENT-SYSTEM 1.0 application where HTTP GET or POST parameters are interpolated into SQL queries without robust neutralization.

Specifically, the name parameter in member_search.php, trainer_search.php, and gym_search.php, and the id parameter in payment_search.php appear to be concatenated directly into query strings.

Any deployment exposing these PHP scripts to untrusted network clients, without compensating controls such as a strong web application firewall or parameterized query handling, is at risk.

Exploit preconditions

  • Attack surface: Public or internal web interface exposing:
  • member_search.php
  • trainer_search.php
  • gym_search.php
  • payment_search.php
  • Required access: None; the issues are reachable by unauthenticated remote users who can send HTTP requests to the affected endpoints.
  • Trigger point: Application functionality that performs search or lookup operations based on name or id parameters and executes SQL on the backend database.
  • Why exploitation is possible: User-controlled values are incorporated into SQL query text without strong input validation, escaping, or parameterization, allowing attackers to alter the structure and logic of the executed SQL statement.

Why this happens

These flaws stem from constructing SQL statements via string concatenation using raw HTTP parameter values instead of using prepared statements or safe query builders.

When the application directly embeds $_GET/$_POST parameters like name and id into SQL clauses, the database cannot distinguish between intended data and injected control tokens such as quotes, operators, or additional statements.

This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where input that should be treated strictly as data is instead interpreted as part of the command, enabling arbitrary query modification.

Potential impact

  • Unauthorized reading of sensitive member, trainer, and payment data
  • Enumeration of user records and extraction of personal information
  • Bypass of authentication or authorization checks controlled by database queries
  • Modification or deletion of membership, trainer, or payment records
  • Potential creation of rogue administrative accounts in the application data store
  • Cascading business impact, including service disruption and integrity loss of gym management records

General mitigation guidance

Effective mitigation focuses on eliminating direct concatenation of user input in SQL and enforcing strict separation of data and code:

  • Prefer parameterized queries or prepared statements for all database interactions, binding user-supplied values as parameters rather than embedding them in SQL strings.
  • Apply input validation and normalization for search and ID fields, limiting values to expected formats (such as numeric-only IDs or constrained text patterns) and rejecting out-of-scope input.
  • Centralize database access through a data access layer or ORM that discourages raw SQL and encourages safe-by-default query APIs.
  • Reduce database privileges for the application account to the minimum needed for normal operations so that even if a query is abused, the range of possible actions is limited.
  • Consider layering defenses with a web application firewall or request filtering policies that detect and block obvious SQL injection patterns at the edge.

How teams detect issues like this

Detection can rely on a combination of automated and manual techniques:

  • Use static application security testing (SAST) tools to flag dynamic SQL construction patterns (e.g., string concatenation of SQL with $_GET/$_POST variables in PHP).
  • During code review, look for direct use of request parameters in SQL queries, lack of parameter binding, and absence of a centralized database abstraction layer.
  • Apply dynamic application security testing (DAST) or interactive testing against staging environments to probe search and payment endpoints with injection patterns and observe error messages or anomalous responses.
  • Enforce secure coding guidelines and pre-merge policies that require prepared statements for all database access, with automated checks to prevent the introduction of raw SQL string concatenation.

Sources

SourceLink
github.comgithub.com/AbhishekMali21/GYM-MANAGEMENT-SYSTEM/issues/4

Frequently asked

questions

Yes. The vulnerable search and payment endpoints are accessible over HTTP, and an attacker can exploit the issue remotely by sending crafted requests containing malicious name or id values.

No. The description indicates that the vulnerable endpoints can be reached by unauthenticated users, so any network user with access to the application can attempt exploitation.

Replace all dynamically constructed SQL that includes user input with parameterized queries or prepared statements, validate and constrain inputs to expected formats, and ensure the application never concatenates raw request data into SQL strings.

Establish secure database access patterns as a project standard, use frameworks or libraries that default to parameterized queries, add static analysis and code review checklists focused on injection risks, and enforce least-privilege database roles to reduce the blast radius of any remaining issues.

Find out what's already
exploitable in your codebase.