Skip to contentSkip to conversation

zabbix: fix CVE-2022-43515,CVE-2022-46768

PATCH New [email protected] 1 participant 1 message Jan 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zabbix: fix CVE-2022-43515,CVE-2022-46768

From: Changqing Li <[email protected]>

---
 .../zabbix/zabbix/CVE-2022-43515.patch        | 37 +++++++++++++
 .../zabbix/zabbix/CVE-2022-46768.patch        | 53 +++++++++++++++++++
 .../zabbix/zabbix_5.4.12.bb                   |  2 +
 3 files changed, 92 insertions(+)
 create mode 100644 meta-oe/recipes-connectivity/zabbix/zabbix/CVE-2022-43515.patch
 create mode 100644 meta-oe/recipes-connectivity/zabbix/zabbix/CVE-2022-46768.patch
meta-oe/recipes-connectivity/zabbix/zabbix/CVE-2022-43515.patch new file +37 -0
new file mode 100644
index 0000000000..6028520923
@@ -0,0 +1,37 @@
+From 6b5dfdb31aa503bb0358784c632ff3a04e7a8ff4 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Wed, 4 Jan 2023 13:51:03 +0800
+Subject: [PATCH] [DEV-2301] fixed spoofing X-Forwarded-For request header
+ allows to access Frontend in maintenace mode
+
+Upstream-Status: Backport [https://git.zabbix.com/projects/ZBX/repos/zabbix/commits/50668e9d64af32cdc67a45082c556699ff86565e]
+CVE: CVE-2022-43515
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ ui/include/classes/user/CWebUser.php | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/ui/include/classes/user/CWebUser.php b/ui/include/classes/user/CWebUser.php
+index e6e651e..bfacce7 100644
+--- a/ui/include/classes/user/CWebUser.php
++++ b/ui/include/classes/user/CWebUser.php
+@@ -231,13 +231,11 @@ class CWebUser {
+ 	}
+ 
+ 	/**
+-	 * Get user ip address.
++	 * Get user IP address.
+ 	 *
+ 	 * @return string
+ 	 */
+ 	public static function getIp(): string {
+-		return (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && $_SERVER['HTTP_X_FORWARDED_FOR'] !== '')
+-			? $_SERVER['HTTP_X_FORWARDED_FOR']
+-			: $_SERVER['REMOTE_ADDR'];
++		return $_SERVER['REMOTE_ADDR'];
+ 	}
+ }
+-- 
+2.25.1
+
meta-oe/recipes-connectivity/zabbix/zabbix/CVE-2022-46768.patch new file +53 -0

53 lines not on this page · raw message

meta-oe/recipes-connectivity/zabbix/zabbix_5.4.12.bb +2 -0
index f5d89d6c3d..d72d3b1122 100644
@@ -26,6 +26,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 SRC_URI = "https://cdn.zabbix.com/zabbix/sources/stable/5.4/${BPN}-${PV}.tar.gz \
     file://0001-Fix-configure.ac.patch \
     file://zabbix-agent.service \
+    file://CVE-2022-43515.patch \
+    file://CVE-2022-46768.patch \
 "
 
 SRC_URI[md5sum] = "f295fd2df86143d72f6ff26e47d9e39e"
Signature · 1 line
2.25.1