CVE-2026-6189
SQL Injection in SourceCodester Pharmacy System Allows Remote Exploit
Publication date: 2026-04-13
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-6189 is a critical SQL injection vulnerability found in the SourceCodester Pharmacy Sales and Inventory System 1.0, specifically in the '/ajax.php?action=login' file. The vulnerability arises because the 'username' parameter is not properly validated or sanitized before being used in SQL queries.
This flaw allows attackers to inject malicious SQL code remotely without any authentication, potentially leading to unauthorized access to the database, data leakage, modification, deletion, or even full system compromise.
A proof-of-concept demonstrates a time-based blind SQL injection attack that can confirm the vulnerability by causing delays in database responses.
How can this vulnerability impact me? :
This vulnerability can have severe impacts including unauthorized access to sensitive data stored in the database, data leakage, and unauthorized modification or deletion of data.
Attackers can exploit this flaw remotely without authentication, which increases the risk of full system compromise or disruption of services.
Such impacts can lead to loss of data integrity, confidentiality breaches, and operational downtime.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by testing the 'username' parameter in the '/ajax.php?action=login' endpoint for SQL injection flaws.
A proof-of-concept payload to test for a time-based blind SQL injection is: username=admin' AND (SELECT 4050 FROM (SELECT(SLEEP(5)))IipN) AND 'GRld'='GRld&password=admin
Using tools like sqlmap can automate detection and confirm the vulnerability by enumerating databases.
- Example sqlmap command: sqlmap -u "http://target/ajax.php?action=login" --data "username=admin&password=admin" --time-sec=5 --technique=T
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include:
- Use prepared statements with parameter binding to separate SQL code from user input, preventing injection.
- Implement strict input validation and filtering to ensure inputs conform to expected formats.
- Minimize database user permissions by avoiding high-privilege accounts (e.g., root or admin) for routine operations.
- Conduct regular security audits 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, modification, or deletion of sensitive information. Such unauthorized data exposure and manipulation can lead to non-compliance with data protection regulations like GDPR and HIPAA, which mandate strict controls over personal and health-related data confidentiality, integrity, and availability.
Failure to remediate this vulnerability promptly could result in breaches of protected data, potentially causing legal and financial consequences under these standards.