Skip to content

Commit c920e5e

Browse files
CBL-Mariner-Botv-smalavathujslobodzian
authored
[AUTO-CHERRYPICK] [Medium] reaper: Fix CVE-2024-52798 - branch main (#12535)
Co-authored-by: Sreenivasulu Malavathula (HCL Technologies Ltd) <v-smalavathu@microsoft.com> Co-authored-by: jslobodzian <joslobo@microsoft.com>
1 parent f8b0110 commit c920e5e

2 files changed

Lines changed: 49 additions & 2 deletions

File tree

SPECS/reaper/CVE-2024-52798.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From 4d91e1915e5e1c9a0e65cb9e47fae3867438ac47 Mon Sep 17 00:00:00 2001
2+
From: Sreenivasulu Malavathula <v-smalavathu@microsoft.com>
3+
Date: Sun, 9 Feb 2025 09:15:14 -0600
4+
Subject: [PATCH] Address CVE-2024-52798
5+
6+
---
7+
src/ui/node_modules/path-to-regexp/index.js | 15 +++++++++++----
8+
1 file changed, 11 insertions(+), 4 deletions(-)
9+
10+
diff --git a/src/ui/node_modules/path-to-regexp/index.js b/src/ui/node_modules/path-to-regexp/index.js
11+
index 39b7caac..4922e0a3 100644
12+
--- a/src/ui/node_modules/path-to-regexp/index.js
13+
+++ b/src/ui/node_modules/path-to-regexp/index.js
14+
@@ -72,20 +72,26 @@ function pathToRegexp(path, keys, options) {
15+
path = path.replace(
16+
/\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g,
17+
function (match, slash, format, key, capture, star, optional, offset) {
18+
- pos = offset + match.length;
19+
-
20+
if (match[0] === '\\') {
21+
backtrack += match;
22+
+ pos += 2;
23+
return match;
24+
}
25+
26+
if (match === '.') {
27+
backtrack += '\\.';
28+
extraOffset += 1;
29+
+ pos += 1;
30+
return '\\.';
31+
}
32+
33+
- backtrack = slash || format ? '' : path.slice(pos, offset);
34+
+ if (slash || format) {
35+
+ backtrack = '';
36+
+ } else {
37+
+ backtrack += path.slice(pos, offset);
38+
+ }
39+
+
40+
+ pos = offset + match.length;
41+
42+
if (match === '*') {
43+
extraOffset += 3;
44+
--
45+
2.45.2
46+

SPECS/reaper/reaper.spec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ Patch9: CVE-2024-48949.patch
4545
Patch10: CVE-2024-45590.patch
4646
Patch11: CVE-2024-21538.patch
4747
Patch12: CVE-2020-28458.patch
48-
Patch13: CVE-2020-24025.patch
48+
Patch13: CVE-2024-52798.patch
49+
Patch14: CVE-2020-24025.patch
4950

5051
BuildRequires: git
5152
BuildRequires: javapackages-tools
@@ -184,7 +185,7 @@ fi
184185

185186
%changelog
186187
* Mon Feb 17 2025 Kanishk Bansal <kanbansal@microsoft.com> - 3.1.1-16
187-
- Patch CVE-2020-24025
188+
- Patch CVE-2020-24025 and CVE-2024-52798
188189

189190
* Sat Nov 16 2024 Sudipta Pandit <sudpandit@microsoft.com> - 3.1.1-15
190191
- Patch CVE-2024-21538 in node modules

0 commit comments

Comments
 (0)