PHP cURL Security Bypass

OWASP 2013-A5 OWASP 2017-A6 OWASP 2021-A5 CWE-644 WASC-13

Curl is a command line tool and library for transferring data using URL. Curl supports almost all protocols like HTTP, HTTPs, FTP, FTPs, IMAP, IMAPS etc. CURL comes under free and open source software. The latest stable version of curl is 7.60.0. This was released on 16th May 2018.

There are many servers having Unfiltered curl file support. As curl supports any protocol, there are chances for many attacks like:-

file inclusion Command Injection etc.


The below code is a form.

        <form method="POST" action="beagletest.cgi">
        <input type=text name="Name">
        <input type=submit name=press value="OK">


The form can be submitted through curl as follows.

        curl --data "Name=sashwat&press=%20OK%20"


Using this format, an attacker can use curl to interact with server.


Using this vulnerability, an attacker can:-

  • 1manipulate sensitive information
  • leak sensitive information
  • gain administrator access to the web application

Mitigation / Precaution

Beagle recommends the following:-

  • Create a whitelist of accepted URLs.
  • Deny the usage of file:// protocol.

Latest Articles