itsourcecode Sales and Inventory System V1.0 SQL Injection Vulnerability
NAME OF AFFECTED PRODUCT(S)
- Sales and Inventory System
Vendor Homepage
https://itsourcecode.com/free-projects/php-project/sales-inventory-system-using-php-mysql/
AFFECTED AND/OR FIXED VERSION(S)
Submitter
单位署名:西北工业大学网络空间安全学院
第一作者:张大伟
Vulnerable File
VERSION(S)
PROBLEM TYPE
Vulnerability Type
Root Cause
- A SQL injection vulnerability was found in the "/pages/pro_del.php" file of the "Sales and Inventory System Project In PHP". The reason for this issue is that attackers can inject malicious code from the parameter 'id' after logging in with valid credentials. The application fails to properly sanitize or validate this input before using it in SQL queries. This allows attackers to manipulate SQL queries and perform unauthorized operations.
Impact
- Attackers can exploit this SQL injection vulnerability to no unauthorized database access, sensitive data leakage, data tampering, comprehensive system control, and even service interruption, posing a serious threat to system security and business continuity.
DESCRIPTION
During the security review of "Sales and Inventory System", a critical SQL injection vulnerability was discovered in the "/pages/pro_del.php" file. attackers can inject malicious SQL queries through this parameter. Immediate remedial measures are needed to ensure system security and protect data integrity.
Vulnerability Location:
POC:
GET /pages/pro_del.php?type=product&id=1%20AND%20GTID_SUBSET(CONCAT(0x716b627171,(SELECT%20(ELT(5570%3D5570,1))),0x71626a7171),5570) HTTP/1.1
Host: 154.219.114.125:1288
Cookie: PHPSESSID=qi5ro4k6du8vil4rf7o3miluu4
Suggested Repair
-
Use Prepared Statements and Parameter Binding:
Preparing statements can prevent SQL injection as they separate SQL code from user input data. When using prepared statements, the value entered by the user is treated as pure data and will not be interpreted as SQL code.
-
Input Validation and Filtering:
Strictly validate and filter user input data to ensure it conforms to the expected format. For example, ensure that nominee IDs match a valid numeric pattern.
-
Minimize Database User Permissions:
Ensure that the account used to connect to the database has the minimum necessary permissions. Avoid using accounts with advanced permissions (such as 'root' or 'admin') for daily operations.
-
Regular Security Audits:
Regularly conduct code and system security audits to promptly identify and fix potential security vulnerabilities.
itsourcecode Sales and Inventory System V1.0 SQL Injection Vulnerability
NAME OF AFFECTED PRODUCT(S)
Vendor Homepage
https://itsourcecode.com/free-projects/php-project/sales-inventory-system-using-php-mysql/
AFFECTED AND/OR FIXED VERSION(S)
Submitter
单位署名:西北工业大学网络空间安全学院
第一作者:张大伟
Vulnerable File
VERSION(S)
PROBLEM TYPE
Vulnerability Type
Root Cause
Impact
DESCRIPTION
During the security review of "Sales and Inventory System", a critical SQL injection vulnerability was discovered in the "/pages/pro_del.php" file. attackers can inject malicious SQL queries through this parameter. Immediate remedial measures are needed to ensure system security and protect data integrity.
Vulnerability Location:
POC:
Suggested Repair
Use Prepared Statements and Parameter Binding:
Preparing statements can prevent SQL injection as they separate SQL code from user input data. When using prepared statements, the value entered by the user is treated as pure data and will not be interpreted as SQL code.
Input Validation and Filtering:
Strictly validate and filter user input data to ensure it conforms to the expected format. For example, ensure that nominee IDs match a valid numeric pattern.
Minimize Database User Permissions:
Ensure that the account used to connect to the database has the minimum necessary permissions. Avoid using accounts with advanced permissions (such as 'root' or 'admin') for daily operations.
Regular Security Audits:
Regularly conduct code and system security audits to promptly identify and fix potential security vulnerabilities.