Sumeru Cyber Security
  • Sumeru Cyber Security
  • Workarounds for prevalent vulnerabilities
    • Version Disclosure
    • Host Header Attack
    • HttpOnly and Secure Flag
    • Security Headers
    • Clickjacking
    • Weak Password
    • Username Enumeration
    • jQuery Outdated
    • Cross-Origin Resource Sharing
    • AWS S3 Bucket Misconfiguration
    • Directory Listing
    • Laravel Debug Enabled
    • Autocomplete and Remember Password Enabled
    • Brute Force Attack
    • Cross Site Request Forgery
    • SQL Injection
    • PhpMyAdmin page Available Publicly
    • Implementation of BASIC Authentication
    • Cache Browsing
    • Insecure Direct Object Reference
    • Active mixed content over https
    • Improper forgot password implementation
    • ASP.NET Debug Enabled
    • Sensitive Data Sent in GET Request
    • Weak CAPTCHA Implementation
    • Csv Injection
    • Cross Site Scripting
    • Web Server Robot.txt Information Disclosure
    • SSL Related Issues
    • Local File Inclusion
    • Weak CAPTCHA Implementation
    • Automated Form Submission
    • Php.ini File Available Publicly
    • ITLP
    • Internal Path Disclosure
    • Insecure Direct Object Reference
    • Access Token Not Expiring After Logout
  • OWASP A09-Security Logging and Monitoring Failures
  • OWASP API09-Improper Inventory Management v1.0
Powered by GitBook
On this page
  • Introduction
  • Impact
  • How To Test
  • How To Fix
  • PHP

Was this helpful?

  1. Workarounds for prevalent vulnerabilities

Automated Form Submission

PreviousWeak CAPTCHA ImplementationNextPhp.ini File Available Publicly

Last updated 5 years ago

Was this helpful?

Introduction

It is possible to automate the form submission process & submit multiple forms.

Impact

This vulnerability could cause loss of availability and results filling database with unwanted forms. This may leads to DOS(Denial of Service) attack to the server.

How To Test

Step1

  • Go to the respective site (Eg: )

  • Open Burp suite Community Edition. Here, is the to configuration on your browser.

  • In burp suite, go to proxy tab and go to HTTP history. By capturing the above request when click “Click to Add” send this request to the intruder by right click on the packet.as shown in the below screenshots.

Step 2

In this intruder add the testing point for performing automated form submission by clicking Add as shown in the below screenshots.

In payloads tab set payload type as numbers, set the number range from 1 to 20 and start the attack as shown in the below screenshots.

For All the requests showing the response as 200 as shown in the below screenshots.

All the requests submitted successfully as shown in the below screenshot.

How To Fix

PHP

Sample Code: For client side

<form method="POST" action="add.php"> 
<?php $_SESSION['user_token'] = md5(uniqid()); ?>    àTo create the random session token using MD5 unique id function 
<input type="hidden" name="token" value="<?php echo $_SESSION['user_token'] ?>"/>  ->This token is stored in this hidden field 
<input type="test" name="textField" placeholder="Enter the data"> 
<input name="add" type="submit" value="Click to Add"> 
</form> 

For Server side,
<?php 
if(isset($_POST['add'])) 
{ 
$token = $_POST['token']; 
        if($token == $_SESSION['user_token'])   àChecking the token which is matching or not if it matches. Condition will be true and process the statements 
{ 
$textField = $_POST['textField']; 
$sql = "INSERT INTO records (sample) VALUES ('$textField')"; 
$conn->query($sql); 
$_SESSION['user_token'] = md5(uniqid());   à Generating new session token to avoid the automated form submission request 
echo 'Record inserted'; 
} 
        else       {                                                         
echo 'Record not inserted'; 
} 
} 
?> 
  • We recommend implementing CAPTCHA that prevents automated form submission.

  • Rate limit can be implemented in server side.

http://localhost/home.php
Blog