CVE-2026-7126
SQL Injection in SourceCodester Pharmacy System /ajax.php
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
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 attackers to gain unauthorized access to sensitive data, modify or delete records, and potentially take full control over the system. Such unauthorized access and data manipulation can lead to breaches of confidentiality, integrity, and availability of personal and sensitive information.
This kind of security flaw can negatively impact compliance with common standards and regulations like GDPR and HIPAA, which require organizations to protect personal data against unauthorized access and ensure data integrity and availability. Exploitation of this vulnerability could result in data breaches, exposing personal health information or other sensitive data, thereby violating these regulations and potentially leading to legal and financial consequences.
Can you explain this vulnerability to me?
CVE-2026-7126 is a critical SQL injection vulnerability found in version 1.0 of the Pharmacy Sales and Inventory System, specifically in the file /ajax.php?action=save_category. The vulnerability occurs because the id parameter is improperly handled and directly used in SQL queries without proper input validation or sanitization.
This flaw allows attackers to inject malicious SQL code through the id parameter, enabling unauthorized manipulation of database queries. Exploitation requires no authentication, making it highly accessible to attackers.
A proof-of-concept demonstrates a boolean-based blind SQL injection attack using a crafted payload in the id parameter, confirming the vulnerability.
How can this vulnerability impact me? :
This vulnerability can have severe impacts including unauthorized database access, extraction of sensitive data, modification or deletion of records, and potentially full control over the affected system.
Attackers can disrupt services and threaten system security and business continuity by exploiting this flaw.
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=save_category endpoint for SQL injection via the id parameter.
A proof-of-concept demonstrates a boolean-based blind SQL injection attack using a multipart POST request with a crafted payload in the id parameter.
The sqlmap tool has been used successfully to confirm the presence of this vulnerability and to enumerate the database.
- Use sqlmap with a command targeting the vulnerable endpoint, for example: sqlmap -u "http://target/ajax.php?action=save_category" --data="id=1" --method=POST
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include:
- Use prepared statements with parameter binding to prevent SQL injection by separating SQL code from user input.
- Implement strict input validation and filtering to ensure inputs conform to expected formats.
- Limit database user permissions to the minimum necessary, avoiding use of high-privilege accounts like root or admin for routine operations.
- Conduct regular security audits of code and systems to detect and address vulnerabilities promptly.