[zabbix] Patch LDAP security issue CVE-2013-1364

Volker Fröhlich volter at fedoraproject.org
Thu Jan 17 21:26:11 UTC 2013


commit 3de3e1238c2a133e649ba753c33b058a95705d37
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Thu Jan 17 22:25:04 2013 +0100

    Patch LDAP security issue CVE-2013-1364

 zabbix-2.0.4-ldap.patch |   66 +++++++++++++++++++++++++++++++++++++++++++++++
 zabbix.spec             |   10 ++++++-
 2 files changed, 75 insertions(+), 1 deletions(-)
---
diff --git a/zabbix-2.0.4-ldap.patch b/zabbix-2.0.4-ldap.patch
new file mode 100644
index 0000000..65d92a8
--- /dev/null
+++ b/zabbix-2.0.4-ldap.patch
@@ -0,0 +1,66 @@
+Index: frontends/php/authentication.php
+===================================================================
+--- frontends/php/authentication.php	(revision 32376)
++++ frontends/php/authentication.php	(revision 32393)
+@@ -101,12 +101,11 @@
+ 			$config['authentication_type'] = $_REQUEST['config'];
+ 
+ 			// check login/password
+-			$login = API::User()->ldapLogin(array(
+-				'user' => get_request('user', $USER_DETAILS['alias']),
+-				'password' => get_request('user_password', ''),
+-				'cnf' => $ldap_cnf
+-			));
++			$ldap = new CLdap($ldap_cnf);
++			$ldap->connect();
++			$login = $ldap->checkPass(get_request('user', $USER_DETAILS['alias']), get_request('user_password', ''));
+ 			if (!$login) {
++				error(_('Login name or password is incorrect'));
+ 				throw new Exception();
+ 			}
+ 
+@@ -129,12 +128,13 @@
+ 	}
+ 	elseif (isset($_REQUEST['test'])) {
+ 		// check login/password
+-		$result = API::User()->ldapLogin(array(
+-			'user' => get_request('user', $USER_DETAILS['alias']),
+-			'password' => get_request('user_password', ''),
+-			'cnf' => $ldap_cnf
+-		));
++		$ldap = new CLdap($ldap_cnf);
++		$ldap->connect();
++		$result = $ldap->checkPass(get_request('user', $USER_DETAILS['alias']), get_request('user_password', ''));
+ 
++		if (!$result)
++			error(_('Login name or password is incorrect'));{
++		}
+ 		show_messages($result, _('LDAP login successful'), _('LDAP login was not successful'));
+ 	}
+ }
+Index: frontends/php/api/classes/CUser.php
+===================================================================
+--- frontends/php/api/classes/CUser.php	(revision 32376)
++++ frontends/php/api/classes/CUser.php	(revision 32393)
+@@ -822,15 +822,12 @@
+ 	// ******************************************************************************
+ 	// LOGIN Methods
+ 	// ******************************************************************************
+-	public function ldapLogin($user) {
+-		$cnf = isset($user['cnf']) ? $user['cnf'] : null;
+-
+-		if (is_null($cnf)) {
+-			$config = select_config();
+-			foreach ($config as $id => $value) {
+-				if (zbx_strpos($id, 'ldap_') !== false) {
+-					$cnf[str_replace('ldap_', '', $id)] = $config[$id];
+-				}
++	protected function ldapLogin($user) {
++		$config = select_config();
++		$cnf = array();
++		foreach ($config as $id => $value) {
++			if (zbx_strpos($id, 'ldap_') !== false) {
++				$cnf[str_replace('ldap_', '', $id)] = $config[$id];
+ 			}
+ 		}
+ 
diff --git a/zabbix.spec b/zabbix.spec
index 25227a4..4199a7a 100644
--- a/zabbix.spec
+++ b/zabbix.spec
@@ -36,7 +36,7 @@
 
 Name:           zabbix
 Version:        2.0.4
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Open-source monitoring solution for your IT infrastructure
 
 Group:          Applications/Internet
@@ -78,6 +78,10 @@ Patch4:         %{srcname}-2.0.3-snmp-source-address.patch
 #https://support.zabbix.com/browse/ZBX-6101
 Patch5:         %{srcname}-2.0.4-snmptrap.patch
 
+#https://support.zabbix.com/browse/ZBX-6097
+#CVE-2013-1364
+Patch6:         %{srcname}-2.0.4-ldap.patch
+
 BuildRequires:   mysql-devel
 BuildRequires:   postgresql-devel
 BuildRequires:   sqlite-devel
@@ -300,6 +304,7 @@ sed -i '/su zabbix zabbix/d' %{SOURCE5}
 %endif
 %patch4 -p0
 %patch5 -p0
+%patch6 -p0
 
 # Remove flash applet
 # https://support.zabbix.com/browse/ZBX-4794
@@ -875,6 +880,9 @@ fi
 %files web-pgsql
 
 %changelog
+* Thu Jan 17 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-3
+- Patch for CVE-2013-1364
+
 * Mon Jan 14 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-2
 - New upstream release
 - Synchronized spec file with zabbix20


More information about the scm-commits mailing list