Skip to contentSkip to conversation

util-linux: Fix CVE-2024-28085

PATCH In review ssambu 3 participants 5 messages Apr 19, 2024 – May 28, 2024

lore
Share & tools
lore

ssambu

author
#0 lore raw

PATCH 1/1 util-linux: Fix CVE-2024-28085

From: Soumya Sambu <[email protected]>

wall in util-linux through 2.40, often installed with setgid tty permissions, allows escape sequences to be sent to other users' terminals through argv. (Specifically, escape sequences received from stdin are blocked, but escape sequences received from argv are not blocked.) There may be plausible scenarios where this leads to account takeover.

CVE-2024-28085-0004 is the CVE fix and CVE-2024-28085-0001, CVE-2024-28085-0002, CVE-2024-28085-0003 are dependent commits to fix the CVE.

References:
https://nvd.nist.gov/vuln/detail/CVE-2024-28085

---
 meta/recipes-core/util-linux/util-linux.inc   |   4 +
 .../util-linux/CVE-2024-28085-0001.patch      | 202 ++++++++++++++++
 .../util-linux/CVE-2024-28085-0002.patch      | 172 ++++++++++++++
 .../util-linux/CVE-2024-28085-0003.patch      | 223 ++++++++++++++++++
 .../util-linux/CVE-2024-28085-0004.patch      |  34 +++
 5 files changed, 635 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/CVE-2024-28085-0001.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/CVE-2024-28085-0002.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/CVE-2024-28085-0003.patch
 create mode 100644 meta/recipes-core/util-linux/util-linux/CVE-2024-28085-0004.patch
meta/recipes-core/util-linux/util-linux.inc +4 -0
index 982ec669a2..72c028ac3d 100644
@@ -35,6 +35,10 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
            file://run-ptest \
            file://display_testname_for_subtest.patch \
            file://avoid_parallel_tests.patch \
+           file://CVE-2024-28085-0001.patch \
+           file://CVE-2024-28085-0002.patch \
+           file://CVE-2024-28085-0003.patch \
+           file://CVE-2024-28085-0004.patch \
            "
 
 SRC_URI[sha256sum] = "634e6916ad913366c3536b6468e7844769549b99a7b2bf80314de78ab5655b83"
meta/recipes-core/util-linux/util-linux/CVE-2024-28085-0001.patch new file +202 -0

202 lines not on this page · raw message

meta/recipes-core/util-linux/util-linux/CVE-2024-28085-0002.patch new file +172 -0

172 lines not on this page · raw message

meta/recipes-core/util-linux/util-linux/CVE-2024-28085-0003.patch new file +223 -0

223 lines not on this page · raw message

meta/recipes-core/util-linux/util-linux/CVE-2024-28085-0004.patch new file +34 -0
new file mode 100644
index 0000000000..dd78e029dc
@@ -0,0 +1,34 @@
+From 404b0781f52f7c045ca811b2dceec526408ac253 Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Thu, 21 Mar 2024 11:16:20 +0100
+Subject: [PATCH] wall: fix escape sequence Injection [CVE-2024-28085]
+
+Let's use for all cases the same output function.
+
+Reported-by: Skyler Ferrante <[email protected]>
+Signed-off-by: Karel Zak <[email protected]>
+
+CVE: CVE-2024-28085
+
+Upstream-Status: Backport [https://github.com/util-linux/util-linux/commit/404b0781f52f7c045ca811b2dceec526408ac253]
+
+Signed-off-by: Soumya Sambu <[email protected]>
+---
+ term-utils/wall.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/term-utils/wall.c b/term-utils/wall.c
+index 377db45..1e7e9ab 100644
+--- a/term-utils/wall.c
++++ b/term-utils/wall.c
+@@ -328,7 +328,7 @@ static char *makemsg(char *fname, char **mvec, int mvecsz,
+		int i;
+
+		for (i = 0; i < mvecsz; i++) {
+-			fputs(mvec[i], fs);
++			fputs_careful(mvec[i], fs, '^', true, TERM_WIDTH);
+			if (i < mvecsz - 1)
+				fputc(' ', fs);
+		}
+--
+2.40.0
Signature · 1 line
2.40.0
#1 lore raw

Identical patch was already submitted and then requested to be ignored because the issue is apparently introduced by one of the added patches.
https://lists.openembedded.org/g/openembedded-core/message/197670

Since the vulnerability report claims that our version IS vulnerable, it would be interesting to know where the truth is...
https://github.com/skyler-ferrante/CVE-2024-28085 -> The vulnerable code was introduced in commit cdd3cc7fa4 (2013).

Peter

#2 lore raw

Hi Peter,

Thank you for providing the details.

Based on the information regarding the vulnerability report and the commit history provided, it appears that our code is indeed vulnerable as the commit introducing the vulnerability still exists in our codebase.

Our util-linux version in the kirkstone branch is v2.37.4, and the vulnerable code was introduced in commit cdd3cc7fa4 back in 2013.

I've also noted that Debian is also fixing the CVE, along with the dependent commits mentioned in the offending commits list. They have already added upstream patches to address CVE-2024-28085 (839ff33b), as detailed in their commit here: https://salsa.debian.org/debian/util-linux/-/commit/839ff33b8002189411b679cc9ee99d1a99e099cb.

Please review the provided information, and let me know if there's anything else we need to consider.

Best Regards,
Soumya
________________________________
From: Marko, Peter <[email protected]>
Sent: Friday, April 19, 2024 10:11 PM
To: Sambu, Soumya <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: RE: [OE-core][kirkstone][PATCH 1/1] util-linux: Fix CVE-2024-28085

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Identical patch was already submitted and then requested to be ignored because the issue is apparently introduced by one of the added patches.
https://lists.openembedded.org/g/openembedded-core/message/197670

Since the vulnerability report claims that our version IS vulnerable, it would be interesting to know where the truth is...
https://github.com/skyler-ferrante/CVE-2024-28085 -> The vulnerable code was introduced in commit cdd3cc7fa4 (2013).

Peter

#3 lore raw

Hi Soumya,

Along with Debian, Suse also fixed the issue with those 4 dependent commits
(https://bugzilla.suse.com/show_bug.cgi?id=1221831).

Debian added the "--disable-use-tty-group" configure option during build along with patch for complete fix (
https://launchpad.net/ubuntu/+source/util-linux/2.37.2-4ubuntu3.4). We already have that configure option in the recipe file.

I think we can go ahead with the debian patch fix.

Thanks & Regards,
Vijay

Quoted 48 lines · Soumya

Hi Peter,

Thank you for providing the details.

Based on the information regarding the vulnerability report and the commit history provided, it appears that our code is indeed vulnerable as the commit introducing the vulnerability still exists in our codebase.

Our util-linux version in the kirkstone branch is v2.37.4, and the vulnerable code was introduced in commit cdd3cc7fa4 back in 2013.

I've also noted that Debian is also fixing the CVE, along with the dependent commits mentioned in the offending commits list. They have already added upstream patches to address CVE-2024-28085 (839ff33b), as detailed in their commit here:
https://salsa.debian.org/debian/util-linux/-/commit/839ff33b8002189411b679cc9ee99d1a99e099cb
.

Please review the provided information, and let me know if there's anything else we need to consider.

Best Regards,
Soumya
------------------------------
*From:* Marko, Peter <[email protected]>
*Sent:* Friday, April 19, 2024 10:11 PM
*To:* Sambu, Soumya <[email protected]>; [email protected] < [email protected]>; [email protected] < [email protected]>
*Subject:* RE: [OE-core][kirkstone][PATCH 1/1] util-linux: Fix CVE-2024-28085

CAUTION: This email comes from a non Wind River email account! Do not click links or open attachments unless you recognize the sender and know the content is safe.

Identical patch was already submitted and then requested to be ignored because the issue is apparently introduced by one of the added patches.
https://lists.openembedded.org/g/openembedded-core/message/197670

Since the vulnerability report claims that our version IS vulnerable, it would be interesting to know where the truth is...
https://github.com/skyler-ferrante/CVE-2024-28085 -> The vulnerable code was introduced in commit cdd3cc7fa4 (2013).

Peter

#4 lore raw

Thanks for confirming.

Regards,
Soumya
________________________________
From: Vijay Anusuri <[email protected]>
Sent: Tuesday, May 28, 2024 2:54 PM
To: Sambu, Soumya <[email protected]>
Cc: Marko, Peter <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core][kirkstone][PATCH 1/1] util-linux: Fix CVE-2024-28085

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe. Hi Soumya,

Along with Debian, Suse also fixed the issue with those 4 dependent commits (https://bugzilla.suse.com/show_bug.cgi?id=1221831<https://urldefense.com/v3/__https://bugzilla.suse.com/show_bug.cgi?id=1221831__;!!AjveYdw8EvQ!cyCp4NgpbtgGBXs0V0Uc_ftkkCZ0pXkGBv7cZUX5W1b5fc3fwV5YiW9NC1NTgPsPW9XhRe-iBzfQtt9s1wA39lw$>).

Debian added the "--disable-use-tty-group" configure option during build along with patch for complete fix (https://launchpad.net/ubuntu/+source/util-linux/2.37.2-4ubuntu3.4<https://urldefense.com/v3/__https://launchpad.net/ubuntu/*source/util-linux/2.37.2-4ubuntu3.4__;Kw!!AjveYdw8EvQ!cyCp4NgpbtgGBXs0V0Uc_ftkkCZ0pXkGBv7cZUX5W1b5fc3fwV5YiW9NC1NTgPsPW9XhRe-iBzfQtt9sb_OVOXc$>). We already have that configure option in the recipe file.

I think we can go ahead with the debian patch fix.

Thanks & Regards,
Vijay

On Thu, Apr 25, 2024 at 8:56 AM Sambu, Soumya <[email protected]<mailto:[email protected]>> wrote:
Hi Peter,

Thank you for providing the details.

Based on the information regarding the vulnerability report and the commit history provided, it appears that our code is indeed vulnerable as the commit introducing the vulnerability still exists in our codebase.

Our util-linux version in the kirkstone branch is v2.37.4, and the vulnerable code was introduced in commit cdd3cc7fa4 back in 2013.

I've also noted that Debian is also fixing the CVE, along with the dependent commits mentioned in the offending commits list. They have already added upstream patches to address CVE-2024-28085 (839ff33b), as detailed in their commit here: https://salsa.debian.org/debian/util-linux/-/commit/839ff33b8002189411b679cc9ee99d1a99e099cb<https://urldefense.com/v3/__https://salsa.debian.org/debian/util-linux/-/commit/839ff33b8002189411b679cc9ee99d1a99e099cb__;!!AjveYdw8EvQ!cyCp4NgpbtgGBXs0V0Uc_ftkkCZ0pXkGBv7cZUX5W1b5fc3fwV5YiW9NC1NTgPsPW9XhRe-iBzfQtt9sw21x4gc$>.

Please review the provided information, and let me know if there's anything else we need to consider.

Best Regards,
Soumya
________________________________
From: Marko, Peter <[email protected]<mailto:[email protected]>>
Sent: Friday, April 19, 2024 10:11 PM
To: Sambu, Soumya <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Subject: RE: [OE-core][kirkstone][PATCH 1/1] util-linux: Fix CVE-2024-28085

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Identical patch was already submitted and then requested to be ignored because the issue is apparently introduced by one of the added patches.
https://lists.openembedded.org/g/openembedded-core/message/197670<https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/message/197670__;!!AjveYdw8EvQ!cyCp4NgpbtgGBXs0V0Uc_ftkkCZ0pXkGBv7cZUX5W1b5fc3fwV5YiW9NC1NTgPsPW9XhRe-iBzfQtt9sRV9fOHI$>

Since the vulnerability report claims that our version IS vulnerable, it would be interesting to know where the truth is...
https://github.com/skyler-ferrante/CVE-2024-28085<https://urldefense.com/v3/__https://github.com/skyler-ferrante/CVE-2024-28085__;!!AjveYdw8EvQ!cyCp4NgpbtgGBXs0V0Uc_ftkkCZ0pXkGBv7cZUX5W1b5fc3fwV5YiW9NC1NTgPsPW9XhRe-iBzfQtt9s_sqIAQs$> -> The vulnerable code was introduced in commit cdd3cc7fa4 (2013).

Peter