Rapid7 Vulnerability & Exploit Database

Coppermine Photo Gallery picEditor.php Command Execution

Back to Search

Coppermine Photo Gallery picEditor.php Command Execution

Disclosed
01/30/2008
Created
05/30/2018

Description

This module exploits a vulnerability in the picEditor.php script of Coppermine Photo Gallery versions 1.4.14 and earlier. When configured to use the ImageMagick library, the 'quality', 'angle', and 'clipval' parameters are not properly escaped before being passed to the PHP 'exec' command. In order to reach the vulnerable 'exec' call, the input must pass several validation steps. The vulnerabilities actually reside in the following functions: image_processor.php: rotate_image(...) include/imageObjectIM.class.php: imageObject::cropImage(...) include/imageObjectIM.class.php: imageObject::rotateImage(...) include/imageObjectIM.class.php: imageObject::resizeImage(...) include/picmgmt.inc.php: resize_image(...) NOTE: Use of the ImageMagick library is a non-default option. However, a user can specify its use at installation time.

Author(s)

  • Janek Vind
  • jduck <jduck@metasploit.com>

Platform

Unix

Architectures

cmd

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/unix/webapp/coppermine_piceditor
msf exploit(coppermine_piceditor) > show targets
    ...targets...
msf exploit(coppermine_piceditor) > set TARGET < target-id >
msf exploit(coppermine_piceditor) > show options
    ...show and set options...
msf exploit(coppermine_piceditor) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;