Exploit-DB #3443
Description: PMB Services 3.0.13 - Multiple Remote File Inclusions
Type: webapps
Platform: php
Date: 2007-03-09
Author: K-159

Exploit:
____________________   ___ ___ ________
\_   _____/\_   ___ \ /   |   \\_____  \  
 |    __)_ /    \  \//    ~    \/   |   \ 
 |        \\     \___\    Y    /    |    \
/_______  / \______  /\___|_  /\_______  /
        \/         \/       \/         \/ 

                                        .OR.ID
ECHO_ADV_68$2007

-----------------------------------------------------------------------------------------
[ECHO_ADV_68$2007] PMB Services <= 3.0.13 Multiple Remote File Inclusion Vulnerability
-----------------------------------------------------------------------------------------

Author         : M.Hasran Addahroni
Date           : March, 9th 2007
Location       : Australia, Sydney
Web            : http://advisories.echo.or.id/adv/adv68-K-159-2007.txt
Critical Lvl   : Dangerous
---------------------------------------------------------------------------

Affected software description:
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Application   : PMB Services 
version       : <= 3.0.13
Vendor        : http://www.sigb.net/
Description :

PMB is a completely free ILS (Integrated Library management System). The domain of software for libraries is almost exclusively occupied by proprietary products.
We are some librarians, users and developers deploring this state of affairs.

PMB is based on web technology. This is what we sometimes call a 'web-app'.
PMB requires an HTTP server (such as Apache, but this is not an obligation), the MySQL database and the PHP language.

The main functions of PMB are :

    * Supporting the UNIMARC format
    * Authorities management (authors, publishers, series, subjects...)
    * Management of loans, holds, borrowers...
    * A user-friendly configuration
    * The ability to import full bibliographic records
    * A user-friendly OPAC integrating a browser
    * Loans management with a module designed to serve even the very small establishments
    * Serials management
    * Simple administration procedures that can be handled easily even by the library staff...

---------------------------------------------------------------------------

Vulnerability:
~~~~~~~~~~~~~
- Invalid include function at includes/resa_func.inc.php :

---------------includes/resa_func.inc.php--------------------------------------
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: resa_func.inc.php,v 1.49 2006/10/31 07:59:35 touraine37 Exp $

require_once("$class_path/quotas.class.php");
...
------------------------------------------------------------------

- Invalid include function at includes/bull_info.inc.php :

--------------includes/bull_info.inc.php--------------------------------------
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: bull_info.inc.php,v 1.23 2006/08/29 20:33:32 touraine37 Exp $

// affichage des infos bulletin

require_once($include_path."/resa_func.inc.php");
...
--------------------------------------------------------------------

- Invalid include function at includes/misc.inc.php :

---------------includes/misc.inc.php-------------------------------------
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: misc.inc.php,v 1.46 2006/10/18 17:06:28 dbellamy Exp $

// ----------------------------------------------------------------------------
//	fonctions de formatage de cha.ne
// ----------------------------------------------------------------------------
// reg_diacrit : fonction pour traiter les caractres accentu.s en recherche avec regex

// choix de la classe ? utiliser pour envoi en pdf
if (!$fpdf) {
	if ($charset != 'utf-8') $fpdf = 'FPDF'; else $fpdf = 'UFPDF';
}

require_once($include_path."/marc_tables/".$lang."/empty_words");

...
------------------------------------------------------------------

- Invalid include function at opac_css/rec_panier.php:

-------------opac_css/rec_panier.php------------------------------
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: rec_panier.php,v 1.5 2006/12/10 10:04:10 touraine37 Exp $

require_once($base_path.'/includes/session.inc.php');

?>
-----------------------------------------------------------------

- - Invalid include function at opac_css/includes/author_see.inc.php :

--------------------opac_css/includes/author_see.inc.php------------------------
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: author_see.inc.php,v 1.32 2006/12/29 16:10:04 touraine37 Exp $

// affichage du detail pour un auteur

require_once($base_path.'/includes/templates/author.tpl.php');
...
----------------------------------------------------------------


Variables $class_path $include_path and $base_path are not properly sanitized.
When register_globals=on and allow_fopenurl=on an attacker can exploit this vulnerability with a simple php injection script.

also affected files :

includes/options/options_date_box.php
includes/options/options_file_box.php
includes/options/options_list.php
includes/options/options_query_list.php
includes/options/options_text.php
includes/options_empr/options.php
includes/options_empr/options_comment.php
includes/options_empr/options_date_box.php
in