Skip to content

Commit ac36195

Browse files
[AUTO-CHERRYPICK] socat: address CVE-2024-54661 - branch main (#11824)
Co-authored-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
1 parent 590972c commit ac36195

2 files changed

Lines changed: 43 additions & 2 deletions

File tree

SPECS/socat/CVE-2024-54661.patch

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From be474a81dc2d9010ac16f9690f97cf7ff68b36d7 Mon Sep 17 00:00:00 2001
2+
From: Muhammad Falak R Wani <falakreyaz@gmail.com>
3+
Date: Sun, 29 Dec 2024 17:47:45 +0530
4+
Subject: [PATCH] CVE-2024-54661: Arbitrary file overwrite in readline.sh
5+
6+
Link: https://repo.or.cz/socat.git/commit/4ee1f31cf80019c5907876576d6dfd49368d660f
7+
Author: Gerhard Rieger <gerhard@dest-unreach.org>
8+
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
9+
---
10+
readline.sh | 10 ++++++++--
11+
1 file changed, 8 insertions(+), 2 deletions(-)
12+
13+
diff --git a/readline.sh b/readline.sh
14+
index b6f8438..1045303 100755
15+
--- a/readline.sh
16+
+++ b/readline.sh
17+
@@ -22,9 +22,15 @@ if [ "$withhistfile" ]; then
18+
else
19+
HISTOPT=
20+
fi
21+
-mkdir -p /tmp/$USER || exit 1
22+
#
23+
#
24+
25+
-exec socat -d readline"$HISTOPT",noecho='[Pp]assword:' exec:"$PROGRAM",sigint,pty,setsid,ctty,raw,echo=0,stderr 2>/tmp/$USER/stderr2
26+
+if test -w .; then
27+
+ STDERR=./socat-readline.${1##*/}.log
28+
+ rm -f $STDERR
29+
+else
30+
+ STDERR=/dev/null
31+
+fi
32+
+
33+
+exec socat -d readline"$HISTOPT",noecho='[Pp]assword:' exec:"$PROGRAM",sigint,pty,setsid,ctty,raw,echo=0,stderr 2>$STDERR
34+
35+
--
36+
2.40.1
37+

SPECS/socat/socat.spec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
Summary: Multipurpose relay (SOcket CAT)
22
Name: socat
33
Version: 1.7.4.3
4-
Release: 1%{?dist}
4+
Release: 2%{?dist}
55
License: GPL2
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
88
Group: Applications/Internet
99
URL: http://www.dest-unreach.org/socat
1010
Source0: http://www.dest-unreach.org/socat/download/%{name}-%{version}.tar.gz
11+
Patch0: CVE-2024-54661.patch
1112

1213
%description
1314
Socat is a command line based utility that establishes two bidirectional byte streams and transfers data between them. Because the streams can be constructed from a large set of different types of data sinks and sources (see address types), and because lots of address options may be applied to the streams, socat can be used for many different purposes.
1415

1516
%prep
16-
%setup -q
17+
%autosetup -p1
1718

1819
%build
1920
./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir}
@@ -36,6 +37,9 @@ make %{?_smp_mflags} test
3637
%{_mandir}/man1/*
3738

3839
%changelog
40+
* Sun Dec 29 2024 Muhammad Falak <mwani@microsoft.com> - 1.7.4.3-2
41+
- Patch CVE-2024-54661
42+
3943
* Mon Jan 24 2022 Neha Agarwal <nehaagarwal@microsoft.com> - 1.7.4.3-1
4044
- Update to version 1.7.4.3.
4145

0 commit comments

Comments
 (0)