Skip to contentSkip to conversation

shadow: Fix CVE-2023-4641

PATCH New ssambu 1 participant 1 message Sep 21, 2023

lore
Share & tools
lore

ssambu

author
#0 lore raw

PATCH 1/1 shadow: Fix CVE-2023-4641

From: Soumya Sambu <[email protected]>

shadow-utils: possible password leak during passwd(1) change

---
 .../shadow/files/CVE-2023-4641-0001.patch     |  36 +++++
 .../shadow/files/CVE-2023-4641-0002.patch     | 147 ++++++++++++++++++
 meta/recipes-extended/shadow/shadow.inc       |   2 +
 3 files changed, 185 insertions(+)
 create mode 100644 meta/recipes-extended/shadow/files/CVE-2023-4641-0001.patch
 create mode 100644 meta/recipes-extended/shadow/files/CVE-2023-4641-0002.patch
meta/recipes-extended/shadow/files/CVE-2023-4641-0001.patch new file +36 -0
new file mode 100644
index 0000000000..2d3c462f4d
@@ -0,0 +1,36 @@
+From 58b6e97a9eef866e9e479fb781aaaf59fb11ef36 Mon Sep 17 00:00:00 2001
+From: Christian Göttsche <[email protected]>
+Date: Mon Apr 25 12:17:40 2022 +0200
+Subject: [PATCH 1/2] passwd: erase password copy on all error branches
+
+CVE: CVE-2023-4641
+
+Upstream-Status: Backport [https://github.com/shadow-maint/shadow/commit/58b6e97a9eef866e9e479fb781aaaf59fb11ef36]
+
+Signed-off-by: Soumya Sambu <[email protected]>
+---
+ src/passwd.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/passwd.c b/src/passwd.c
+index 80531ec..8c6f81a 100644
+--- a/src/passwd.c
++++ b/src/passwd.c
+@@ -289,6 +289,7 @@ static int new_password (const struct passwd *pw)
+		cp = getpass (_("New password: "));
+		if (NULL == cp) {
+			memzero (orig, sizeof orig);
++			memzero (pass, sizeof pass);
+			return -1;
+		}
+		if (warned && (strcmp (pass, cp) != 0)) {
+@@ -316,6 +317,7 @@ static int new_password (const struct passwd *pw)
+		cp = getpass (_("Re-enter new password: "));
+		if (NULL == cp) {
+			memzero (orig, sizeof orig);
++			memzero (pass, sizeof pass);
+			return -1;
+		}
+		if (strcmp (cp, pass) != 0) {
+--
+2.40.0
meta/recipes-extended/shadow/files/CVE-2023-4641-0002.patch new file +147 -0

147 lines not on this page · raw message

meta/recipes-extended/shadow/shadow.inc +2 -0
index 3c1dd2f98e..57b5002e8b 100644
@@ -18,6 +18,8 @@ SRC_URI = "https://github.com/shadow-maint/shadow/releases/download/v${PV}/${BP}
            file://useradd \
            file://CVE-2023-29383.patch \
            file://0001-Overhaul-valid_field.patch \
+	   file://CVE-2023-4641-0001.patch \
+	   file://CVE-2023-4641-0002.patch \
            "
 
 SRC_URI:append:class-target = " \
Signature · 1 line
2.40.0