CVE-2026-6187
Received Received - Intake
SQL Injection in SourceCodester Pharmacy System /ajax.php

Publication date: 2026-04-13

Last updated on: 2026-04-29

Assigner: VulDB

Description
A vulnerability was detected in SourceCodester Pharmacy Sales and Inventory System 1.0. This issue affects some unknown processing of the file /ajax.php?action=chk_prod_availability. The manipulation of the argument ID results in sql injection. The attack may be performed from remote. The exploit is now public and may be used.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-13
Last Modified
2026-04-29
Generated
2026-05-06
AI Q&A
2026-04-13
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
sourcecodester pharmacy_sales_and_inventory_system 1.0
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
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 can this vulnerability impact me? :

The SQL injection vulnerability can allow an attacker to access, modify, or delete sensitive data in the database.

Since the attack can be performed remotely without authentication, it increases the risk of unauthorized data exposure or data loss.


Can you explain this vulnerability to me?

This vulnerability exists in SourceCodester Pharmacy Sales and Inventory System 1.0. It involves improper handling of the 'ID' argument in the file /ajax.php?action=chk_prod_availability, which allows an attacker to perform SQL injection.

An attacker can manipulate the 'ID' parameter remotely to inject malicious SQL commands, potentially compromising the database.


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, modification or deletion of records, and potential full control over the system without authentication.

Such unauthorized access and data manipulation can lead to breaches of confidentiality, integrity, and availability of sensitive information, which are critical requirements under common standards and regulations like GDPR and HIPAA.

Failure to address this vulnerability may result in non-compliance with these regulations due to potential exposure of personal or health-related data, leading to legal and financial consequences.


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=chk_prod_availability, specifically targeting the id parameter for SQL injection.

A proof-of-concept involves sending crafted SQL injection payloads via POST requests to the id parameter to observe boolean-based blind SQL injection behavior.

Tools like sqlmap can be used to automate detection by targeting the id parameter in POST requests to /ajax.php?action=chk_prod_availability.

  • Example payload to test manually: id=(SELECT (CASE WHEN (4784=4784) THEN 5 ELSE (SELECT 7976 UNION SELECT 3350) END))
  • Use sqlmap command: sqlmap -u "http://target/ajax.php?action=chk_prod_availability" --data="id=1" --method=POST --risk=3 --level=5

What immediate steps should I take to mitigate this vulnerability?

Immediate mitigation steps include implementing prepared statements with parameter binding to prevent SQL injection.

Strict input validation and filtering should be applied 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 for routine operations.

Conduct regular security audits of the code and system to detect and fix vulnerabilities promptly.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart