Pandora FMS 3.1 - Authentication Bypass







[+] Introduction

Pandora FMS (for Pandora Flexible Monitoring System) is a software
solution for monitoring computer networks. It allows monitoring in a
visual way the status and performance of several parameters from
different operating systems, servers, applications and hardware systems
such as firewalls, proxies, databases, web servers or routers.

It can be deployed in almost any operating system. It features remote
monitoring (WMI, SNMP, TCP. UDP, ICMP, HTTP...) and it can also use
agents. An agent is available for each platform. It can also monitor
hardware systems with a TCP/IP stack, such as load balancers, routers,
network switches, printers or firewalls.

This software has several servers that process and get information from
different sources, using WMI for gathering remote Windows information, a
predictive server, a plug-in server which makes complex user-defined
network tests, an advanced export server to replicate data between
different sites of Pandora FMS, a network discovery server, and an SNMP
Trap console.

Released under the terms of the GNU General Public License, Pandora FMS
is free software.

[+] Description and Proof of Concept

1) Authentication bypass - CVE-2010-4279 - CVSS: 10/10

An attacker could access to any account user, including admin, using the
"hash login" authentication process. This kind of authentication method
works providing a username and a hash. The issue could be exploited
remotely providing a username and the md5 of it when
$config['loginhash_pwd'] is empty, that in fact is the default

Snippet of vulnerable code in index.php:

136 // Hash login process
137 if (! isset ($config['id_user']) && isset ($_GET["loginhash"])) {
138         $loginhash_data = get_parameter("loginhash_data", "");
139         $loginhash_user = get_parameter("loginhash_user", "");
141         if ($loginhash_data ==
md5($loginhash_user.$config["loginhash_pwd"])) {
142                 logon_db ($loginhash_user, $_SERVER['REMOTE_ADDR']);
143                 $_SESSION['id_usuario'] = $loginhash_user;
144                 $config["id_user"] = $loginhash_user;

Proof of concept:


Got it! admin! :)

By default, any installation of this software allows unauthenticated
attackers to perform an authentication bypass and a privilege escalation
to admin.

1.1) Additionally, a manual modification in order to use the hash_hmac
function instead of the weak statement md5 ( $string . $KEY) is
encouraged for security purposes.

Snippet of code (index.php, version 3.1.1):

145 // Hash login process
150         if ($config["loginhash_pwd"] != "" && $loginhash_data ==
md5($loginhash_user.$config["loginhash_pwd"])) {

In line 150, use
hash_hmac("sha256",$loginhash_user,$config["loginhash_pwd"]), instead of

[+] Impact

An attacker can execute commands of the operating system, inject remote
code in the context of the application, get arbitrary files from the
filesystem or extract any data of the database including passwords and
confidential information about the monitored network/systems. Also it is
possible to bypass the authentication or scale privileges to became
admin, gaining full control of the web application and web server. These
vulnerabilities have a high impact to the confidentiality, integrity,
and availability of the system.

[+] Systems affected

Versions prior and including 3.1 of Pandora FMS are affected

[+] Solution

Apply the security fix for version 3.1:

Or upgrade to version 3.1.1 from

[+] Timeline

Ago 2010: First contact to vendor
Ago 2010: Confirmation of vendor
Sept 2010: Second contact: SQL Injection vulnerabilities
Sept 2010: Confirmation that the fix will be released on October
Oct 2010: PandoraFMS security patch for 3.1 version released
Oct 2010: Request for CVE numbers
Nov 2010: PandoraFMS version 3.1.1 released
Nov 2010: Disclosure of this advisory

[+] References

Official PandoraFMS site:
SourceForge PandoraFMS site:
Wikipedia entry about PandoraFMS:
Common Vulnerability Scoring System (CVSS) v2 calculator:
Common Vulnerabilities and Exposures (CVE):

[+] Credits

These vulnerabilities has been discovered by Juan Galiana Lara -
@jgaliana -

Version: GnuPG v1.4.10 (GNU/Linux)