Campcodes Online Polling System V1.0 /Online_Polling_System/admin/checklogin.php SQL injection NAME OF AFFECTED PRODUCT(S) Online Polling System Vendor Homepage Online Polling System AFFECTED AND/OR FIXED VERSION(S) V1.0 Software Link Online Polling System Source Code PROBLEM TYPE Vulnerability Type SQL injection Root Cause A SQL injection vulnerability was found in the '/Online_Polling_System/admin/checklogin.php' file of the 'Online Polling System' project. Attackers inject malicious code from the parameter 'myusername' directly in SQL queries without the need for appropriate cleaning or validation. This allows them to forge input values, manipulate SQL queries, and perform 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. This poses a serious threat to system security and business continuity. DESCRIPTION During a security review of "Online Polling System," a critical SQL injection vulnerability was discovered in the "/Online_Polling_System/admin/checklogin.php" file. This vulnerability stems from insufficient user input validation of the 'myusername' parameter, allowing attackers to inject malicious SQL queries. Hence, 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 location: 'myusername' parameter Payload: sqlmap运行结果截图 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.