SourceCodester Pharmacy Sales and Inventory System SQL Injection Vulnerability

Vulnerability

A SQL injection vulnerability has been identified in SourceCodester Pharmacy Sales and Inventory System version 1.0. The issue arises in the file '/ajax.php?action=save_type', where insufficient validation of the 'id' parameter allows attackers to inject malicious SQL queries. This vulnerability can be exploited remotely, without any authentication, potentially leading to unauthorized database access, data manipulation, and leakage of sensitive information.

Impact

Exploitation of this vulnerability allows for SQL injection, enabling attackers to interfere with the application's database queries. This could lead to unauthorized data access, data modification or deletion, and in some cases, executing administrative operations on the database.

Reproduction

To reproduce this vulnerability, send a POST request to '/ajax.php?action=save_type' with a crafted 'id' parameter that includes malicious SQL payloads. The injection can be verified by observing the application's response, which may indicate successful exploitation, such as returning database information or application data that should not be accessible.

Remediation

It is recommended to use prepared statements and parameterized queries to prevent SQL injection. Additionally, input validation and sanitization should be implemented to ensure that user input is properly checked before being processed. Regular security audits can help identify and address vulnerabilities proactively.

Added: Apr 27, 2026, 2:21 PM
Updated: Apr 27, 2026, 2:21 PM

Vulnerability Rating

Custom Algorithm
spread
0.3
impact
3.1
exploitability
9.1
remediation
0.0
relevance
6.8
threat
6.4
urgency
2.9
incentive
8.3

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.