CVE-2026-7128
SQL Injection in SourceCodester Pharmacy System /ajax.php Remote Exploit
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
Can you explain this vulnerability to me?
CVE-2026-7128 is a critical SQL injection vulnerability found in version 1.0 of the Pharmacy Sales and Inventory System. It occurs in the file /ajax.php when accessed with the parameter action=save_type. The vulnerability arises because the id parameter is not properly sanitized or validated before being used in SQL queries, allowing attackers to inject malicious SQL code.
This flaw enables attackers to manipulate SQL queries by submitting crafted input through the id parameter, which can lead to unauthorized database access, data leakage, data tampering, full system compromise, and potential service disruption.
Exploitation does not require any authentication or login, making it easier for remote attackers to exploit this vulnerability.
How can this vulnerability impact me? :
This vulnerability can have severe impacts including unauthorized access to the database, leakage of sensitive data, tampering or modification of data, complete system compromise, and disruption of services.
Because the exploit can be executed remotely without authentication, attackers can easily exploit this flaw to gain control over the system or extract confidential information.
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 endpoint with the parameter action=save_type and injecting SQL payloads into the id parameter to check for SQL injection flaws.
A proof of concept involves sending a boolean-based blind SQL injection payload via a multipart POST request targeting the id parameter.
Tools like sqlmap can be used to automate detection and exploitation attempts by targeting the vulnerable parameter.
- Use sqlmap with a command similar to: sqlmap -u "http://target/ajax.php?action=save_type" --data="id=1" --method=POST --batch
- Manually test by sending crafted POST requests with SQL injection payloads in the id parameter to observe abnormal responses or errors.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include:
- Implement prepared statements with parameter binding to separate SQL code from user input, preventing injection.
- Apply strict input validation and filtering to ensure the id parameter only accepts expected formats.
- Limit database user permissions to the minimum necessary, avoiding use of high-privilege accounts such as root or admin.
- Conduct regular security audits of code and systems to detect and fix 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 1.0 can lead to unauthorized database access, data leakage, and data tampering. Such security breaches can result in the exposure or alteration of sensitive personal or health information.
This exposure and compromise of data integrity can negatively impact compliance with common standards and regulations like GDPR and HIPAA, which mandate the protection of personal and health data against unauthorized access and ensure data confidentiality and integrity.
Failure to address this vulnerability could lead to violations of these regulations, potentially resulting in legal penalties, loss of trust, and damage to the organization's reputation.