Introduction

There is a SQL Injection in editbrand.php in Pharmacy Management System v1.0.
I put all the php files to the web root path, so I use /invoiceprint.php, or it can also be placed at /dawapharma/dawapharma/invoiceprint.php etc.

POC

image.png
the “10.3.34-MariaDB-0+deb10ul” is the database version I use, so it is a SQL injection that can echo the content.
POC:

  1. /invoiceprint.php?id=-1%27%20union%20select%201,2,3,4,5,6,version(),8,9,0,11,12,13,14,15,16,17,18;--+

Vulnerability Analysis

in the invoiceprint.php file, the logic as follows:
image.png
the wabpage use the idparameter as part of sql statement directly.