Skip to content

Commit ffa7d55

Browse files
[AUTO-CHERRYPICK] [High] patch reaper for CVE-2025-48387 & CVE-2024-6484 - branch main (#13989)
Co-authored-by: jykanase <[email protected]>
1 parent 455fe9b commit ffa7d55

File tree

3 files changed

+166
-2
lines changed

3 files changed

+166
-2
lines changed

SPECS/reaper/CVE-2024-6484.patch

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 620b02881ae264fe9cffb008626f1c11de4447d4 Mon Sep 17 00:00:00 2001
2+
From: Sergey Odinokov <[email protected]>
3+
Date: Tue, 18 Mar 2025 12:00:44 +0700
4+
Subject: [PATCH] Fix CVE-2024-6484 vulnerability by disabling further event
5+
handling
6+
7+
Upstream Link: https://github.com/odinserj/bootstrap/commit/0ea568be7ff0c1f72a693f5d782277a9e9872077
8+
---
9+
src/ui/bower_components/bootstrap/dist/js/bootstrap.js | 2 +-
10+
src/ui/bower_components/bootstrap/js/carousel.js | 2 +-
11+
src/ui/node_modules/bootstrap/dist/js/bootstrap.js | 2 +-
12+
src/ui/node_modules/bootstrap/js/carousel.js | 2 +-
13+
4 files changed, 4 insertions(+), 4 deletions(-)
14+
15+
diff --git a/src/ui/bower_components/bootstrap/dist/js/bootstrap.js b/src/ui/bower_components/bootstrap/dist/js/bootstrap.js
16+
index 8a2e99a5..3bf1104b 100644
17+
--- a/src/ui/bower_components/bootstrap/dist/js/bootstrap.js
18+
+++ b/src/ui/bower_components/bootstrap/dist/js/bootstrap.js
19+
@@ -508,7 +508,7 @@ if (typeof jQuery === 'undefined') {
20+
var href
21+
var $this = $(this)
22+
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
23+
- if (!$target.hasClass('carousel')) return
24+
+ if (!$target.hasClass('carousel')) return false
25+
var options = $.extend({}, $target.data(), $this.data())
26+
var slideIndex = $this.attr('data-slide-to')
27+
if (slideIndex) options.interval = false
28+
diff --git a/src/ui/bower_components/bootstrap/js/carousel.js b/src/ui/bower_components/bootstrap/js/carousel.js
29+
index 6ff954c9..f878dcda 100644
30+
--- a/src/ui/bower_components/bootstrap/js/carousel.js
31+
+++ b/src/ui/bower_components/bootstrap/js/carousel.js
32+
@@ -209,7 +209,7 @@
33+
var href
34+
var $this = $(this)
35+
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
36+
- if (!$target.hasClass('carousel')) return
37+
+ if (!$target.hasClass('carousel')) return false
38+
var options = $.extend({}, $target.data(), $this.data())
39+
var slideIndex = $this.attr('data-slide-to')
40+
if (slideIndex) options.interval = false
41+
diff --git a/src/ui/node_modules/bootstrap/dist/js/bootstrap.js b/src/ui/node_modules/bootstrap/dist/js/bootstrap.js
42+
index 170bd608..71087569 100644
43+
--- a/src/ui/node_modules/bootstrap/dist/js/bootstrap.js
44+
+++ b/src/ui/node_modules/bootstrap/dist/js/bootstrap.js
45+
@@ -517,7 +517,7 @@ if (typeof jQuery === 'undefined') {
46+
var target = $this.attr('data-target') || href
47+
var $target = $(document).find(target)
48+
49+
- if (!$target.hasClass('carousel')) return
50+
+ if (!$target.hasClass('carousel')) return false
51+
52+
var options = $.extend({}, $target.data(), $this.data())
53+
var slideIndex = $this.attr('data-slide-to')
54+
diff --git a/src/ui/node_modules/bootstrap/js/carousel.js b/src/ui/node_modules/bootstrap/js/carousel.js
55+
index a5fcac31..54a44fcf 100644
56+
--- a/src/ui/node_modules/bootstrap/js/carousel.js
57+
+++ b/src/ui/node_modules/bootstrap/js/carousel.js
58+
@@ -217,7 +217,7 @@
59+
var target = $this.attr('data-target') || href
60+
var $target = $(document).find(target)
61+
62+
- if (!$target.hasClass('carousel')) return
63+
+ if (!$target.hasClass('carousel')) return false
64+
65+
var options = $.extend({}, $target.data(), $this.data())
66+
var slideIndex = $this.attr('data-slide-to')
67+
--
68+
2.34.1
69+

SPECS/reaper/CVE-2025-48387.patch

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
From 14f532dae3732b4bdba2821d31d6bce663cf8dd5 Mon Sep 17 00:00:00 2001
2+
From: jykanase <[email protected]>
3+
Date: Tue, 10 Jun 2025 07:51:46 +0000
4+
Subject: [PATCH] CVE-2025-48387
5+
6+
Upstream Patch Reference: https://github.com/mafintosh/tar-fs/commit/647447b572bc135c41035e82ca7b894f02b17f0f
7+
---
8+
.../bower/lib/node_modules/tar-fs/index.js | 39 +++++++++++--------
9+
1 file changed, 22 insertions(+), 17 deletions(-)
10+
11+
diff --git a/tmp_local/lib/node_modules/bower/lib/node_modules/tar-fs/index.js b/tmp_local/lib/node_modules/bower/lib/node_modules/tar-fs/index.js
12+
index 3fd93bc..7659b01 100644
13+
--- a/tmp_local/lib/node_modules/bower/lib/node_modules/tar-fs/index.js
14+
+++ b/tmp_local/lib/node_modules/bower/lib/node_modules/tar-fs/index.js
15+
@@ -266,16 +266,20 @@ exports.extract = function (cwd, opts) {
16+
var onlink = function () {
17+
if (win32) return next() // skip links on win for now before it can be tested
18+
xfs.unlink(name, function () {
19+
- var dst = path.join(cwd, path.join('/', header.linkname))
20+
+ var link = path.join(cwd, path.join('/', header.linkname))
21+
22+
- xfs.link(dst, name, function (err) {
23+
- if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) {
24+
- stream = xfs.createReadStream(dst)
25+
- return onfile()
26+
- }
27+
+ fs.realpath(link, function (err, dst) {
28+
+ if (err || !inCwd(dst)) return next(new Error(name + ' is not a valid hardlink'))
29+
30+
- stat(err)
31+
- })
32+
+ xfs.link(dst, name, function (err) {
33+
+ if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) {
34+
+ stream = xfs.createReadStream(dst)
35+
+ return onfile()
36+
+ }
37+
+
38+
+ stat(err)
39+
+ })
40+
+ })
41+
})
42+
}
43+
44+
@@ -297,19 +301,19 @@ exports.extract = function (cwd, opts) {
45+
})
46+
}
47+
48+
- if (header.type === 'directory') {
49+
- stack.push([name, header.mtime])
50+
- return mkdirfix(name, {
51+
- fs: xfs, own: own, uid: header.uid, gid: header.gid
52+
- }, stat)
53+
- }
54+
-
55+
- var dir = path.dirname(name)
56+
+ var dir = path.join(name, '.') === path.join(cwd, '.') ? cwd : path.dirname(name)
57+
58+
validate(xfs, dir, path.join(cwd, '.'), function (err, valid) {
59+
if (err) return next(err)
60+
if (!valid) return next(new Error(dir + ' is not a valid path'))
61+
62+
+ if (header.type === 'directory') {
63+
+ stack.push([name, header.mtime])
64+
+ return mkdirfix(name, {
65+
+ fs: xfs, own: own, uid: header.uid, gid: header.gid
66+
+ }, stat)
67+
+ }
68+
+
69+
mkdirfix(dir, {
70+
fs: xfs, own: own, uid: header.uid, gid: header.gid
71+
}, function (err) {
72+
@@ -336,8 +340,9 @@ exports.extract = function (cwd, opts) {
73+
74+
function validate (fs, name, root, cb) {
75+
if (name === root) return cb(null, true)
76+
+
77+
fs.lstat(name, function (err, st) {
78+
- if (err && err.code !== 'ENOENT') return cb(err)
79+
+ if (err && err.code !== 'ENOENT' && err.code !== 'EPERM') return cb(err)
80+
if (err || st.isDirectory()) return validate(fs, path.join(name, '..'), root, cb)
81+
cb(null, false)
82+
})
83+
--
84+
2.45.2
85+

SPECS/reaper/reaper.spec

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Summary: Reaper for cassandra is a tool for running Apache Cassandra repairs against single or multi-site clusters.
77
Name: reaper
88
Version: 3.1.1
9-
Release: 18%{?dist}
9+
Release: 19%{?dist}
1010
License: ASL 2.0
1111
Vendor: Microsoft Corporation
1212
Distribution: Mariner
@@ -49,6 +49,8 @@ Patch13: CVE-2024-52798.patch
4949
Patch14: CVE-2020-24025.patch
5050
Patch15: CVE-2024-28863.patch
5151
Patch16: CVE-2024-12905.patch
52+
Patch17: CVE-2024-6484.patch
53+
Patch18: CVE-2025-48387.patch
5254

5355
BuildRequires: git
5456
BuildRequires: javapackages-tools
@@ -114,7 +116,12 @@ popd
114116
pushd $tmp_local_dir/n/versions/node/14.18.0/lib/node_modules/
115117
%autopatch -p1 15
116118
popd
117-
%autopatch -p1 16
119+
%autopatch -p1 -m 16
120+
121+
# Removed for CVE-2024-6484.patch as they are unused and contain
122+
# vulnerabilities that are not easily patched out.
123+
rm src/ui/bower_components/bootstrap/dist/js/bootstrap.min.js
124+
rm src/ui/node_modules/bootstrap/dist/js/bootstrap.min.js
118125

119126
rsync -azvhr $tmp_local_dir/ "%{_prefix}/local"
120127
rm -rf $tmp_local_dir
@@ -192,6 +199,9 @@ fi
192199
%{_unitdir}/cassandra-%{name}.service
193200

194201
%changelog
202+
* Thu Jun 05 2025 Jyoti Kanase <[email protected]> - 3.1.1-19
203+
- Patch CVE-2024-6484 and CVE-2025-48387
204+
195205
* Fri Apr 04 2025 Sandeep Karambelkar ([email protected]> - 3.1.1-18
196206
- Add patch to fix CVE-2024-12905
197207

0 commit comments

Comments
 (0)