Skip to contentSkip to conversation

webmin: patch CVE-2017-15644, CVE-2017-15645 and CVE-2017-15646

PATCH New Gyorgy Sarvari 1 participant 5 messages Oct 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 webmin: patch CVE-2017-15644, CVE-2017-15645 and CVE-2017-15646

Details: https://nvd.nist.gov/vuln/detail/CVE-2017-15644
https://nvd.nist.gov/vuln/detail/CVE-2017-15645
https://nvd.nist.gov/vuln/detail/CVE-2017-15646

Pick the patch mentioned in the nvd report (same patch is marked to fix all three vulnerabilities).

---
 ...e-potentially-malicious-HTTP-headers.patch | 53 +++++++++++++++++++
 .../recipes-webadmin/webmin/webmin_1.850.bb   |  3 +-
 2 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 meta-webserver/recipes-webadmin/webmin/files/0001-Escape-potentially-malicious-HTTP-headers.patch
meta-webserver/recipes-webadmin/webmin/files/0001-Escape-potentially-malicious-HTTP-headers.patch new file +53 -0
new file mode 100644
index 0000000000..f5d1a7d0e5
@@ -0,0 +1,53 @@
+From 5a06f972b1fd64f3da46187edf4998af0266a53b Mon Sep 17 00:00:00 2001
+From: Jamie Cameron <[email protected]>
+Date: Tue, 5 Sep 2017 10:35:44 -0700
+Subject: [PATCH] Escape potentially malicious HTTP headers
+
+CVE: CVE-2017-15644 CVE-2017-15645 CVE-2017-15646
+Upstream-Status: Backport [https://github.com/webmin/webmin/commit/0c58892732ee7610a7abba5507614366d382c9c9]
+
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ web-lib-funcs.pl | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl
+index 1fcd96ab..df673bb7 100755
+--- a/web-lib-funcs.pl
++++ b/web-lib-funcs.pl
+@@ -2308,7 +2308,7 @@ alarm(0);
+ $h = $main::download_timed_out if ($main::download_timed_out);
+ if (!ref($h)) {
+ 	if ($error) { $$error = $h; return; }
+-	else { &error($h); }
++	else { &error(&html_escape($h)); }
+ 	}
+ &complete_http_download($h, $dest, $error, $cbfunc, $osdn, $host, $port,
+ 			$headers, $ssl, $nocache);
+@@ -2336,7 +2336,7 @@ if ($line !~ /^HTTP\/1\..\s+(200|30[0-9]|400)(\s+|$)/) {
+ 	alarm(0);
+ 	&close_http_connection($_[0]);
+ 	if ($_[2]) { ${$_[2]} = $line; return; }
+-	else { &error("Download failed : $line"); }
++	else { &error("Download failed : ".&html_escape($line)); }
+ 	}
+ my $rcode = $1;
+ &$cbfunc(1, $rcode >= 300 && $rcode < 400 ? 1 : 0)
+@@ -2382,7 +2382,7 @@ if ($rcode >= 300 && $rcode < 400) {
+ 		# Assume relative to same dir .. not handled
+ 		&close_http_connection($_[0]);
+ 		if ($_[2]) { ${$_[2]} = "Invalid Location header $header{'location'}"; return; }
+-		else { &error("Invalid Location header $header{'location'}"); }
++		else { &error("Invalid Location header ".&html_escape($header{'location'})); }
+ 		}
+ 	else {
+ 		&close_http_connection($_[0]);
+@@ -2411,7 +2411,7 @@ else {
+ 		if (!&open_tempfile(PFILE, ">$_[1]", 1)) {
+ 			&close_http_connection($_[0]);
+ 			if ($_[2]) { ${$_[2]} = "Failed to write to $_[1] : $!"; return; }
+-			else { &error("Failed to write to $_[1] : $!"); }
++			else { &error("Failed to write to ".&html_escape($_[1])." : ".&html_escape("$!")); }
+ 			}
+ 		binmode(PFILE);		# For windows
+ 		while(defined($buf = &read_http_connection($_[0], 1024))) {
meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb +2 -1
index 35ec09daea..bc71c74474 100644
@@ -19,7 +19,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \
            file://remove-python2.3.patch \
            file://mysql-config-fix.patch \
            file://webmin.service \
-            "
+           file://0001-Escape-potentially-malicious-HTTP-headers.patch \
+           "
 
 SRC_URI[md5sum] = "cd6ee98f73f9418562197675b952d81b"
 SRC_URI[sha256sum] = "c66caa9e4cb50d5447bc8aceb7989d2284dde060278f404b13e171c7ce1690e1"
#1 lore raw

PATCH 2/5 webmin: patch CVE-2017-17089

Details: https://nvd.nist.gov/vuln/detail/CVE-2017-17089

Pick the patch referenced in the nvd report.

---
 ...0001-HTML-escape-command-description.patch | 29 +++++++++++++++++++
 .../recipes-webadmin/webmin/webmin_1.850.bb   |  1 +
 2 files changed, 30 insertions(+)
 create mode 100644 meta-webserver/recipes-webadmin/webmin/files/0001-HTML-escape-command-description.patch
meta-webserver/recipes-webadmin/webmin/files/0001-HTML-escape-command-description.patch new file +29 -0
new file mode 100644
index 0000000000..f4078c7f4f
@@ -0,0 +1,29 @@
+From 0d5e731a173767e7e4ea2051a7a33c8e5cc57880 Mon Sep 17 00:00:00 2001
+From: Jamie Cameron <[email protected]>
+Date: Mon, 27 Nov 2017 08:50:15 -0800
+Subject: [PATCH] HTML escape command description
+
+CVE: CVE-2017-17089
+Upstream-Status: Backport [https://github.com/webmin/webmin/commit/a9c97eea6c268fb83d93a817d58bac75e0d2599e]
+
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ custom/run.cgi | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/custom/run.cgi b/custom/run.cgi
+index 327de410..375b041b 100755
+--- a/custom/run.cgi
++++ b/custom/run.cgi
+@@ -40,8 +40,9 @@ if ($cmd->{'format'} ne 'redirect' && $cmd->{'format'} ne 'form') {
+ 		print "\n";
+ 		}
+ 	else {
+-		&ui_print_unbuffered_header($cmd->{'desc'}, $text{'run_title'},
+-					    "", -d "help" ? "run" : undef);
++		&ui_print_unbuffered_header(
++			&html_escape($cmd->{'desc'}), $text{'run_title'},
++			"", -d "help" ? "run" : undef);
+ 		}
+ 	}
+ 
meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb +1 -0
index bc71c74474..784e3b69b9 100644
@@ -20,6 +20,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \
            file://mysql-config-fix.patch \
            file://webmin.service \
            file://0001-Escape-potentially-malicious-HTTP-headers.patch \
+           file://0001-HTML-escape-command-description.patch \
            "
 
 SRC_URI[md5sum] = "cd6ee98f73f9418562197675b952d81b"
#2 lore raw

PATCH 3/5 webmin: patch CVE-2019-15642

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2019-15642

Pick the patch mentioned in the nvm report.

---
 ...es-cannot-contact-special-characters.patch | 26 +++++++++++++++++++
 .../recipes-webadmin/webmin/webmin_1.850.bb   |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 meta-webserver/recipes-webadmin/webmin/files/0001-Object-names-cannot-contact-special-characters.patch
meta-webserver/recipes-webadmin/webmin/files/0001-Object-names-cannot-contact-special-characters.patch new file +26 -0
new file mode 100644
index 0000000000..9abb02a6ae
@@ -0,0 +1,26 @@
+From 8470368e42af2b66a31a112299df6239fccf111e Mon Sep 17 00:00:00 2001
+From: Jamie Cameron <[email protected]>
+Date: Sat, 3 Aug 2019 22:41:37 -0700
+Subject: [PATCH] Object names cannot contact special characters
+
+CVE: CVE-2019-15642
+Upstream-Status: Backport [https://github.com/webmin/webmin/commit/df8a43fb4bdc9c858874f72773bcba597ae9432c]
+
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ web-lib-funcs.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl
+index df673bb7..bbe154a9 100755
+--- a/web-lib-funcs.pl
++++ b/web-lib-funcs.pl
+@@ -7102,7 +7102,7 @@ elsif ($v[0] eq 'REF') {
+ elsif ($v[0] eq 'UNDEF') {
+ 	$rv = undef;
+ 	}
+-elsif ($v[0] =~ /^OBJECT\s+(.*)$/) {
++elsif ($v[0] =~ /^OBJECT\s+([A-Za-z0-9_:]+)$/) {
+ 	# An object hash that we have to re-bless
+ 	my $cls = $1;
+ 	$rv = { };
meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb +1 -0
index 784e3b69b9..cc31ff35a7 100644
@@ -21,6 +21,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \
            file://webmin.service \
            file://0001-Escape-potentially-malicious-HTTP-headers.patch \
            file://0001-HTML-escape-command-description.patch \
+           file://0001-Object-names-cannot-contact-special-characters.patch \
            "
 
 SRC_URI[md5sum] = "cd6ee98f73f9418562197675b952d81b"
#3 lore raw

PATCH 4/5 webmin: patch CVE-2022-0824

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2022-0824

Pick the patch mentioned in the nvd report.

---
 ...0001-Foreign-module-may-need-a-check.patch | 27 +++++++++++++++++++
 .../recipes-webadmin/webmin/webmin_1.850.bb   |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta-webserver/recipes-webadmin/webmin/files/0001-Foreign-module-may-need-a-check.patch
meta-webserver/recipes-webadmin/webmin/files/0001-Foreign-module-may-need-a-check.patch new file +27 -0
new file mode 100644
index 0000000000..8698030e82
@@ -0,0 +1,27 @@
+From 2659c2990427c587a49014abb5275aec0ea44c0a Mon Sep 17 00:00:00 2001
+From: Ilia Rostovtsev <[email protected]>
+Date: Sun, 20 Feb 2022 12:48:27 +0300
+Subject: [PATCH] Foreign module may need a check
+
+CVE: CVE-2022-0824
+Upstream-Status: Backport [https://github.com/webmin/webmin/commit/39ea464f0c40b325decd6a5bfb7833fa4a142e38]
+
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ web-lib-funcs.pl | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl
+index bbe154a9..4bb2b0d6 100755
+--- a/web-lib-funcs.pl
++++ b/web-lib-funcs.pl
+@@ -4669,7 +4669,8 @@ if ($module_name) {
+ 	}
+ 
+ if ($module_name && !$main::no_acl_check &&
+-    !defined($ENV{'FOREIGN_MODULE_NAME'}) &&
++    (!defined($ENV{'FOREIGN_MODULE_NAME'}) ||
++      defined($ENV{'FOREIGN_MODULE_SEC_CHECK'})) &&
+     $main::webmin_script_type eq 'web') {
+ 	# Check if the HTTP user can access this module
+ 	if (!&foreign_available($module_name)) {
meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb +1 -0
index cc31ff35a7..d553c7530c 100644
@@ -22,6 +22,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \
            file://0001-Escape-potentially-malicious-HTTP-headers.patch \
            file://0001-HTML-escape-command-description.patch \
            file://0001-Object-names-cannot-contact-special-characters.patch \
+           file://0001-Foreign-module-may-need-a-check.patch \
            "
 
 SRC_URI[md5sum] = "cd6ee98f73f9418562197675b952d81b"
#4 lore raw

PATCH 5/5 webmin: patch CVE-2022-0829

In reply to Gyorgy Sarvari

Details: https://nvd.nist.gov/vuln/detail/CVE-2022-0829

Pick the patch from the nvd report details.

---
 ...issions-check-when-saving-allowed-cr.patch | 25 +++++++++++++++++++
 .../recipes-webadmin/webmin/webmin_1.850.bb   |  1 +
 2 files changed, 26 insertions(+)
 create mode 100644 meta-webserver/recipes-webadmin/webmin/files/0001-Add-missing-permissions-check-when-saving-allowed-cr.patch
meta-webserver/recipes-webadmin/webmin/files/0001-Add-missing-permissions-check-when-saving-allowed-cr.patch new file +25 -0
new file mode 100644
index 0000000000..a1ab677bc9
@@ -0,0 +1,25 @@
+From 15dd0e4e55579671c01e4808236beb4fe23e9eef Mon Sep 17 00:00:00 2001
+From: Jamie Cameron <[email protected]>
+Date: Sat, 19 Feb 2022 13:10:36 -0800
+Subject: [PATCH] Add missing permissions check when saving allowed cron users
+
+CVE: CVE-2022-0829
+Upstream-Status: Backport [https://github.com/webmin/webmin/commit/eeeea3c097f5cc473770119f7ac61f1dcfa671b9]
+
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ cron/save_allow.cgi | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cron/save_allow.cgi b/cron/save_allow.cgi
+index 87bbe453..73df9a84 100755
+--- a/cron/save_allow.cgi
++++ b/cron/save_allow.cgi
+@@ -4,6 +4,7 @@
+ 
+ require './cron-lib.pl';
+ &ReadParse();
++$access{'allow'} || &error($text{'allow_ecannot'});
+ 
+ &lock_file($config{cron_allow_file});
+ &lock_file($config{cron_deny_file});
meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb +1 -0
index d553c7530c..78ab19601f 100644
@@ -23,6 +23,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \
            file://0001-HTML-escape-command-description.patch \
            file://0001-Object-names-cannot-contact-special-characters.patch \
            file://0001-Foreign-module-may-need-a-check.patch \
+           file://0001-Add-missing-permissions-check-when-saving-allowed-cr.patch \
            "
 
 SRC_URI[md5sum] = "cd6ee98f73f9418562197675b952d81b"