Skip to content

Commit 0b8dbc4

Browse files
busybox: Address CVE-2023-42366 (#11025)
Signed-off-by: Ankita Pareek <ankitapareek@microsoft.com> Co-authored-by: Ankita Pareek <ankitapareek@microsoft.com>
1 parent e7143fd commit 0b8dbc4

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

SPECS/busybox/CVE-2023-42366.patch

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 5cf8b332429a1dd9afef3337bae92aeddaeff993 Mon Sep 17 00:00:00 2001
2+
From: Valery Ushakov <uwe@stderr.spb.ru>
3+
Date: Wed, 24 Jan 2024 22:24:41 +0300
4+
Subject: [PATCH] awk.c: fix CVE-2023-42366 (bug #15874)
5+
6+
Make sure we don't read past the end of the string in next_token()
7+
when backslash is the last character in an (invalid) regexp.
8+
---
9+
editors/awk.c | 6 ++++--
10+
1 file changed, 4 insertions(+), 2 deletions(-)
11+
12+
diff --git a/editors/awk.c b/editors/awk.c
13+
index 728ee8685..be48df7c7 100644
14+
--- a/editors/awk.c
15+
+++ b/editors/awk.c
16+
@@ -1165,9 +1165,11 @@ static uint32_t next_token(uint32_t expected)
17+
s[-1] = bb_process_escape_sequence((const char **)&pp);
18+
if (*p == '\\')
19+
*s++ = '\\';
20+
- if (pp == p)
21+
+ if (pp == p) {
22+
+ if (*p == '\0')
23+
+ syntax_error(EMSG_UNEXP_EOS);
24+
*s++ = *p++;
25+
- else
26+
+ } else
27+
p = pp;
28+
}
29+
}
30+
--
31+
2.34.1
32+

SPECS/busybox/busybox.spec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Statically linked binary providing simplified versions of system commands
22
Name: busybox
33
Version: 1.36.1
4-
Release: 8%{?dist}
4+
Release: 9%{?dist}
55
License: GPLv2
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -12,9 +12,10 @@ Source2: busybox-petitboot.config
1212
Patch0: busybox-1.31.1-stime-fix.patch
1313
Patch1: CVE-2022-28391.patch
1414
Patch2: CVE-2021-42380.patch
15-
# Also Fixes CVE-2023-42364
1615
Patch3: CVE-2023-42363.patch
16+
# Also Fixes CVE-2023-42364
1717
Patch4: CVE-2023-42365.patch
18+
Patch5: CVE-2023-42366.patch
1819
BuildRequires: gcc
1920
BuildRequires: glibc-static >= 2.38-8%{?dist}
2021
BuildRequires: libselinux-devel >= 1.27.7-2
@@ -103,6 +104,9 @@ SKIP_KNOWN_BUGS=1 ./runtest
103104
%{_mandir}/man1/busybox.petitboot.1.gz
104105

105106
%changelog
107+
* Tue Nov 12 2024 Ankita Pareek <ankitapareek@microsoft.com> - 1.36.1-9
108+
- Address CVE-2023-42366
109+
106110
* Mon Aug 26 2024 Rachel Menge <rachelmenge@microsoft.com> - 1.36.1-8
107111
- Update to build dep latest glibc-static version
108112

0 commit comments

Comments
 (0)