exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

CakePHP 2.3.7 / 2.2.8 Local File Inclusion

CakePHP 2.3.7 / 2.2.8 Local File Inclusion
Posted Aug 13, 2013
Authored by Takeshi Terada

CakePHP versions 2.3.7 and 2.2.8 suffer from a local file inclusion vulnerability.

tags | exploit, local, file inclusion
SHA-256 | 92c71209b2cf74bbca5dffab287435b8882d6cd95365ae3008c5330a8b79f357

CakePHP 2.3.7 / 2.2.8 Local File Inclusion

Change Mirror Download
CVE Number:         N/A (not assigned)
Title: CakePHP AssetDispatcher Local File Inclusion Vulnerability
Affected Software: Confirmed on CakePHP v2.3.7, v2.2.8
(prior versions may also be affected)
Credit: Takeshi Terada of Mitsui Bussan Secure Directions, Inc.
Issue Status: v2.3.8 & 2.2.9 was released which fixes this vulnerability

Overview:
CakePHP is an open-source web application framework for PHP.
CakePHP (v2.3.7, 2.2.8 and possibly prior versions) is vulnerable to
LFI (Local File Inclusion) attack. Remote attacker can abuse this
vulnerability to steal files on the server or execute PHP commands,
if the target application has one or more themes or plugins. It is
caused by insufficient input validation in AssetDispatcher class.

Details:
CakePHP's AssetDispatcher class serves asset resources (such as image
files) stored under individual theme or plugin directory. This class
determines requested resource's path based on PATH_INFO of request URI.

To prevent attacks, this class validates PATH_INFO and stops loading
requested resource if PATH_INFO contains ".." sequence. But after the
validation step, PATH_INFO will be urldecoded in _getAssetFile(). This
allows attackers to bypass ".." check by urlencoded dot chars (%2e).

I present two examples of attack URI. In both examples, Cake serves the
content of /etc/passwd in HTTP response body.

UR1: http://victim-host/cakephp-2.3.7/theme/Test1/%2e.//%2e.//%2e.//%2e.
//%2e.//%2e.//%2e.//%2e.//%2e.//%2e.//%2e.//%2e.//%2e./etc/passwd

Successful attack requires one or more themes on the target server.
In the example above, the target application must have "Test1" theme.
This restriction is due to file_exists() check in beforeDispatch().

URL2: http://victim-host/cakephp-2.3.7/DebugKit/%2e.//%2e.//%2e.//%2e.//
%2e.//%2e.//%2e.//%2e.//%2e.//%2e.//%2e.//%2e.//%2e./etc/passwd

Second example is almost same as first one. The difference is that
second one requires one or more Cake plugins with webroot directory.
The plugins must be actually enabled on the target server.

The requested resource is served via include statement, so that PHP
code execution by LFI is possible if the target Cake application
allows uploading files such as image, text and so on.

Timeline:
2013/07/16 Reported to CakePHP Security ML
2013/07/18 Vender announced v2.3.8 & 2.2.9
2013/08/13 Disclosure of this advisory

Recommendation:
Upgrade to the latest version.

Reference:
http://bakery.cakephp.org/articles/markstory/2013/07/18/cakephp_2_3_8_2_2_9_released
Login or Register to add favorites

File Archive:

October 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close