SourceCodester Comment System SQL Injection Vulnerability

Vulnerability

A SQL injection vulnerability has been identified in SourceCodester Comment System version 1.0, specifically within the post_comment.php file. The issue arises from inadequate input validation of the 'name' parameter, allowing attackers to inject malicious SQL queries. This vulnerability can be exploited remotely, giving attackers unauthorized access to the database, where they could manipulate or leak sensitive data, disrupt services, and potentially gain control over the system.

Impact

Exploitation of this vulnerability allows for unauthorized database access, manipulation or deletion of data, leakage of sensitive information, and disruption of services. Such actions pose a significant threat to system security and business operations.

Reproduction

The vulnerability can be reproduced by sending a POST request to the 'post_comment.php' file with a crafted 'name' parameter that includes malicious SQL payloads. This input is then processed by the application without proper sanitization, allowing the injected SQL to be executed. The exploitation can be verified by using tools like sqlmap to extract database information, such as available databases or tables.

Remediation

To address this vulnerability, it is recommended to implement prepared statements and parameter binding to separate SQL code from user input, conduct thorough input validation and filtering, and minimize database user permissions to the least required.

Added: May 8, 2026, 3:19 AM
Updated: May 8, 2026, 3:19 AM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
5.0
exploitability
6.0
remediation
0.0
relevance
7.8
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.