Skip to content

Commit 825c141

Browse files
authored
[Medium] Patch valkey for CVE-2025-27151 (#14030)
1 parent b637672 commit 825c141

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

SPECS/valkey/CVE-2025-27151.patch

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 992e828dc6f1a20b27780892a97ced9dbdd6e75c Mon Sep 17 00:00:00 2001
2+
From: SumitJenaHCL <v-sumitjena@microsoft.com>
3+
Date: Tue, 17 Jun 2025 17:46:43 +0000
4+
Subject: [PATCH] Patch CVE-2025-27151
5+
6+
Upstream Patch Reference: https://github.com/valkey-io/valkey/commit/73696bf6e2cf754acc3ec24eaf9ca6b879bfc5d7
7+
---
8+
src/valkey-check-aof.c | 6 ++++++
9+
1 file changed, 6 insertions(+)
10+
11+
diff --git a/src/valkey-check-aof.c b/src/valkey-check-aof.c
12+
index bc71d36..c43c30b 100644
13+
--- a/src/valkey-check-aof.c
14+
+++ b/src/valkey-check-aof.c
15+
@@ -556,6 +556,12 @@ int redis_check_aof_main(int argc, char **argv) {
16+
goto invalid_args;
17+
}
18+
19+
+ /* Check if filepath is longer than PATH_MAX */
20+
+ if (strnlen(filepath, PATH_MAX + 1) > PATH_MAX) {
21+
+ printf("Error: filepath is too long (exceeds PATH_MAX)\n");
22+
+ goto invalid_args;
23+
+ }
24+
+
25+
/* In the glibc implementation dirname may modify their argument. */
26+
memcpy(temp_filepath, filepath, strlen(filepath) + 1);
27+
dirpath = dirname(temp_filepath);
28+
--
29+
2.45.2
30+

SPECS/valkey/valkey.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: advanced key-value store
22
Name: valkey
33
Version: 8.0.3
4-
Release: 2%{?dist}
4+
Release: 3%{?dist}
55
License: BSD
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -11,6 +11,7 @@ Source0: https://github.com/valkey-io/valkey/archive/refs/tags/%{version}
1111
Patch0: valkey-conf.patch
1212
Patch1: disable-mem-defrag-tests.patch
1313
Patch2: CVE-2025-49112.patch
14+
Patch3: CVE-2025-27151.patch
1415
BuildRequires: gcc
1516
BuildRequires: make
1617
BuildRequires: openssl-devel
@@ -85,6 +86,9 @@ exit 0
8586
%config(noreplace) %attr(0640, %{name}, %{name}) %{_sysconfdir}/valkey.conf
8687

8788
%changelog
89+
* Wed Jun 18 2025 Sumit Jena <v-sumitjena@microsoft.com> - 8.0.3-3
90+
- Fix CVE-2025-27151
91+
8892
* Thu Jun 12 2025 Sumit Jena <v-sumitjena@microsoft.com> - 8.0.3-2
8993
- Fix CVE-2025-49112
9094

0 commit comments

Comments
 (0)