PHP cURL Security Bypass

By
Prathap
Published on
02 Jul 2018
1 min read
Vulnerability

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.

Example

The below code is a form.

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

    

The form can be submitted through curl as follows.

        curl --data "Name=sashwat&press=%20OK%20"  http://www.beagleexample.com/beagletest.cgi

    

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

Impact

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.
Automated human-like penetration testing for your web apps & APIs
Teams using Beagle Security are set up in minutes, embrace release-based CI/CD security testing and save up to 65% with timely remediation of vulnerabilities. Sign up for a free account to see what it can do for you.

Written by
Prathap
Prathap
Co-founder, Director
Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 10 days
Find surface-level website security issues in under a minute
Free website security assessment
Experience the power of automated penetration testing & contextual reporting.