POST /doctors_appointment/admin/ajax.php?action=login HTTP/1.1
Host: 127.0.0.1
Content-Length: 32
sec-ch-ua-platform: "Windows"
Accept-Language: zh-CN,zh;q=0.9
sec-ch-ua: "Chromium";v="137", "Not/A)Brand";v="24"
sec-ch-ua-mobile: ?0
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Accept: */*
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://127.0.0.1
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://127.0.0.1/doctors_appointment/admin/login.php
Accept-Encoding: gzip, deflate, br
Cookie: PHPSESSID=3osc6gnn22go9tr4kf1e6n4rl5
Connection: keep-alive
username=admin&password=admin123
Simple Doctor's Appointment System in PHP/MySQL Project V1.0 /admin/login.php SQL injection
NAME OF AFFECTED PRODUCT(S)
Vendor Homepage
AFFECTED AND/OR FIXED VERSION(S)
submitter
Vulnerable File
VERSION(S)
Software Link
PROBLEM TYPE
Vulnerability Type
Root Cause
Impact
DESCRIPTION
No login or authorization is required to exploit this vulnerability
Vulnerability details and POC
1.txt
Vulnerability type:
Vulnerability location:
Payload:
The following are screenshots of some specific information obtained from testing and running with the sqlmap tool:
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 prepare 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.
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.