CVE-2026-7391
Received Received - Intake
SQL Injection in Pharmacy Sales and Inventory System

Publication date: 2026-04-29

Last updated on: 2026-04-29

Assigner: VulDB

Description
A flaw has been found in SourceCodester Pharmacy Sales and Inventory System 1.0. This affects the function save_supplier of the file /ajax.php?action=save_supplier. This manipulation of the argument ID causes sql injection. Remote exploitation of the attack is possible. The exploit has been published and may be used.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-29
Last Modified
2026-04-29
Generated
2026-05-07
AI Q&A
2026-04-29
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
Can you explain this vulnerability to me?

This vulnerability is a flaw in the SourceCodester Pharmacy Sales and Inventory System version 1.0. It exists in the function save_supplier within the file /ajax.php?action=save_supplier. The issue arises from improper handling of the argument ID, which allows an attacker to perform SQL injection.

SQL injection is a technique where an attacker manipulates input to execute arbitrary SQL commands on the database, potentially compromising data integrity and confidentiality.

This vulnerability can be exploited remotely, and an exploit has already been published.


How can this vulnerability impact me? :

Exploitation of this vulnerability can allow an attacker to manipulate the database through SQL injection, potentially leading to unauthorized access, data leakage, data modification, or deletion.

Since the vulnerability can be exploited remotely, it increases the risk of unauthorized access without physical presence or prior authentication.

The impact includes loss of data integrity, confidentiality, and availability, which can disrupt business operations and compromise sensitive information.


How can this vulnerability impact me? :

Exploitation of this vulnerability can lead to unauthorized access to sensitive information stored in the database.

Attackers may manipulate or delete data, causing data integrity issues and disrupting normal system operations.

It can also result in service disruption or full system compromise, affecting the availability and reliability of the Pharmacy Sales and Inventory System.


Can you explain this vulnerability to me?

This vulnerability is a SQL injection flaw found in the SourceCodester Pharmacy Sales and Inventory System 1.0, specifically in the save_supplier function within the /ajax.php?action=save_supplier file.

The issue arises because the 'id' parameter is not properly validated, allowing an attacker to manipulate it and inject malicious SQL queries directly into the database.

This can be exploited remotely without authentication, enabling unauthorized access to sensitive data, data tampering, and potentially compromising the entire system.


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, data tampering, and potential system compromise. Such unauthorized access and data manipulation can lead to violations of data protection regulations like GDPR and HIPAA, which require the protection of personal and sensitive information from unauthorized access and breaches.

Exploitation of this vulnerability could result in data leakage or service disruption, both of which are significant compliance risks under these standards. Organizations using the affected system may fail to meet requirements for data integrity, confidentiality, and security controls mandated by these regulations.

Mitigations such as input validation, use of prepared statements, and minimizing database permissions are essential to maintain compliance and reduce the risk of regulatory penalties.


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_supplier endpoint for SQL injection via the 'id' parameter. You can attempt to inject SQL payloads into the 'id' parameter and observe if the system behaves unexpectedly or returns database errors.

  • Use curl or similar tools to send crafted requests, for example: curl -G 'http://target/ajax.php?action=save_supplier' --data-urlencode "id=1' OR '1'='1"
  • Monitor web server logs for suspicious requests targeting /ajax.php?action=save_supplier with unusual or malformed 'id' parameters.
  • Use automated vulnerability scanners that support SQL injection detection on the specified endpoint.

What immediate steps should I take to mitigate this vulnerability?

Immediate mitigation steps include applying input validation and sanitization on the 'id' parameter in /ajax.php?action=save_supplier to prevent SQL injection.

Use prepared statements with parameter binding in the code to safely handle database queries.

Minimize database user permissions to limit the impact of a potential exploit.

Conduct regular security audits and monitor for suspicious activity related to this endpoint.


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_supplier endpoint for SQL injection via the 'id' parameter. You can attempt to inject SQL payloads in the 'id' argument and observe if the system behaves unexpectedly or returns database errors.

A common approach is to use tools like sqlmap or manual curl commands to test for SQL injection.

  • Example curl command to test injection: curl -G 'http://target/ajax.php?action=save_supplier' --data-urlencode "id=1' OR '1'='1"
  • Use sqlmap to automate detection: sqlmap -u "http://target/ajax.php?action=save_supplier&id=1" --batch

What immediate steps should I take to mitigate this vulnerability?

Immediate mitigation steps include:

  • Implement prepared statements with parameter binding to prevent SQL injection.
  • Apply strict input validation on the 'id' parameter to ensure only expected values are accepted.
  • Minimize database user permissions to limit the impact of a potential exploit.
  • Conduct regular security audits and code reviews to identify and fix similar vulnerabilities.

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