CVE-2026-7087
SQL Injection in SourceCodester Pharmacy System Enables Remote Attack
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-7087 is a critical SQL injection vulnerability found in the Pharmacy Sales and Inventory System 1.0, specifically in the file /ajax.php?action=save_sales.
The vulnerability occurs because the application improperly handles the 'id' parameter received via POST requests without adequate input validation or sanitization.
Attackers can inject malicious SQL code through this parameter, manipulating SQL queries directly, which can be exploited remotely without authentication.
This type of SQL injection is Boolean-based blind SQL injection, allowing attackers to craft payloads that alter query logic and extract or manipulate data.
How can this vulnerability impact me? :
Exploitation of this vulnerability can lead to unauthorized database access, data leakage, and data tampering.
Attackers may gain full system control and potentially disrupt services.
Since no authentication is required to exploit this flaw, it poses a significant risk to the confidentiality, integrity, and availability of the affected system.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by testing the vulnerable parameter `id` in the POST request to `/ajax.php?action=save_sales` for SQL injection.
One common method is to use automated tools like sqlmap to verify the presence of SQL injection by attempting to enumerate databases or extract information.
An example sqlmap command to test this vulnerability is:
- sqlmap -u "http://target/ajax.php?action=save_sales" --data="id=1" --method=POST --dbs
Alternatively, manual testing can be done by sending crafted POST requests with payloads such as `id=(SELECT (CASE WHEN (4784=4784) THEN 5 ELSE (SELECT 7976 UNION SELECT 3350) END))` and observing the response for SQL injection behavior.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include:
- Use prepared statements with parameter binding to ensure that user input is not directly included in SQL queries.
- Implement strict input validation and filtering to ensure the `id` parameter only accepts expected formats and values.
- Minimize database user permissions by avoiding the use of high-privilege accounts such as `root` or `admin` for application database operations.
- Conduct regular security audits of the code and system 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 allows unauthorized access, data leakage, and data tampering. Such impacts can lead to violations of data protection regulations like GDPR and HIPAA, which mandate the protection of personal and sensitive information from unauthorized access and breaches.
Failure to secure the system against this vulnerability could result in non-compliance with these standards due to potential exposure of protected health information (PHI) or personally identifiable information (PII), risking legal and financial penalties.
Remediation measures such as using prepared statements, input validation, and minimizing database permissions are critical to maintain compliance and protect data integrity.