Ticket #1429 (closed Security Exploit: fixed)

Opened 4 years ago

Last modified 3 weeks ago

CakePHP Arbitrary File Access

Reported by: gulftech Owned by: Any Developer
Priority: Critical Milestone: 1.2.x.x
Component: Shells Version: 1.1 Stable
Severity: Major Keywords:
Cc:

Description

Hello,

I just downloaded the latest version of CakePHP and noticed a fairly serious security issue.

[code] if (is_file('../../vendors/javascript/' . $_GETfile?) && (preg_match('/(.+)\\.js/', $_GETfile?))) {

readfile('../../vendors/javascript/' . $_GETfile?);

} /code

The above code allows anyone to read any file on the server. I believe this only works if magic quotes gpc is off (which is the default php settings).

 http://localhost/vendors.php?file=../../../../../etc/passwd%00blah.js

A URL like the one above would successfully display the contents of the passwd file.

Change History

Changed 4 years ago by gulftech

BTW, the vulnerable code is in app/webroot/js/vendors.php

Changed 4 years ago by phpnut

  • status changed from new to closed
  • resolution set to invalid

Have you prodcued this exploit or is this an assumption? I have tested with both:

magic_quotes_gpc = On
magic_quotes_gpc = Off

And can not produce this exploit.

Changed 4 years ago by phpnut

  • priority changed from High to Critical
  • status changed from closed to reopened
  • resolution invalid deleted

Changed 4 years ago by phpnut

  • status changed from reopened to closed
  • resolution set to fixed

Sorry after deeper testing this is a valid exploit and is fixed in [3506].

Changed 4 years ago by shin

  • status changed from closed to reopened
  • resolution fixed deleted

Hi, this problem is still in cake/scipts/templates/skel/webroot/js/vendors.php

Changed 4 years ago by dho

  • status changed from reopened to closed
  • resolution set to fixed

Fixed in [3507]. Thanks for reopening the ticket.

Changed 3 weeks ago by Samuel.johnson

Thanks phpnut for the info you had given. | Florida Villas

Note: See TracTickets for help on using tickets.