CVE-2026-7130
SQL Injection in SourceCodester Pharmacy System's delete_category Function
Publication date: 2026-04-27
Last updated on: 2026-04-29
Assigner: VulDB
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| sourcecodester | pharmacy_sales_and_inventory_system | 1.0 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-74 | The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. |
| CWE-89 | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. |
Attack-Flow Graph
AI Powered Q&A
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include implementing prepared statements with parameter binding to separate SQL code from user input.
Enforce strict input validation and filtering to ensure that inputs conform to expected formats.
Minimize database user permissions by avoiding the use of high-privilege accounts such as root or admin for routine database operations.
Conduct regular security audits to detect and address vulnerabilities promptly.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The SQL injection vulnerability in the Pharmacy Sales and Inventory System allows unauthorized access to sensitive data, data tampering, and potential service disruption. Such unauthorized database access and data leakage can lead to violations of data protection regulations like GDPR and HIPAA, which mandate the protection of personal and sensitive information.
Failure to protect data integrity and confidentiality due to this vulnerability could result in non-compliance with these standards, potentially leading to legal penalties, loss of trust, and other regulatory consequences.
Can you explain this vulnerability to me?
CVE-2026-7130 is a critical SQL injection vulnerability found in the SourceCodester Pharmacy Sales and Inventory System 1.0, specifically in the file /ajax.php?action=delete_category.
The flaw arises because the system improperly handles the 'id' parameter received via POST requests without adequate input validation or sanitization.
Attackers can inject malicious SQL code through this parameter, allowing them to manipulate SQL queries executed by the system.
This enables unauthorized users, without needing to log in or authenticate, to perform unauthorized database operations such as accessing sensitive data, modifying or deleting records, and potentially gaining full control over the system.
How can this vulnerability impact me? :
This vulnerability can have severe impacts including unauthorized access to sensitive data stored in the database.
Attackers can modify or delete important records, which can disrupt business operations and compromise data integrity.
It may also lead to full system compromise if attackers gain control over the database or underlying system.
Such impacts pose significant risks to system security and business continuity.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by testing the /ajax.php?action=delete_category endpoint for SQL injection via the id parameter, which is accepted through POST requests without proper validation.
One common approach is to use automated SQL injection testing tools such as sqlmap to confirm exploitability.
- Use sqlmap with a command like: sqlmap -u "http://target/ajax.php?action=delete_category" --data "id=1" --method POST --risk=3 --level=5
- Test boolean-based blind SQL injection payloads manually by sending POST requests with crafted id values, for example: id=(SELECT (CASE WHEN (4784=4784) THEN 5 ELSE (SELECT 7976 UNION SELECT 3350) END))