Skip to content

Commit 02ffe5c

Browse files
authored
ceph: fix CVE-2023-43040 (#9146)
1 parent 39538f4 commit 02ffe5c

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

SPECS/ceph/CVE-2023-43040.patch

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From 98bfb71cb38899333deb58dd2562037450fd7fa8 Mon Sep 17 00:00:00 2001
2+
From: Joshua Baergen <jbaergen@digitalocean.com>
3+
Date: Wed, 17 May 2023 12:17:09 -0600
4+
Subject: [PATCH] rgw: Fix bucket validation against POST policies
5+
6+
It's possible that user could provide a form part as a part of a POST
7+
object upload that uses 'bucket' as a key; in this case, it was
8+
overriding what was being set in the validation env (which is the real
9+
bucket being modified). The result of this is that a user could actually
10+
upload to any bucket accessible by the specified access key by matching
11+
the bucket in the POST policy in said POST form part.
12+
13+
Fix this simply by setting the bucket to the correct value after the
14+
POST form parts are processed, ignoring the form part above if
15+
specified.
16+
17+
Fixes: https://tracker.ceph.com/issues/63004
18+
19+
Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
20+
Signed-off-by: Henry Beberman <henry.beberman@microsoft.com>
21+
diff -Naur a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc
22+
--- a/src/rgw/rgw_rest_s3.cc 2022-07-21 17:28:56.000000000 +0000
23+
+++ b/src/rgw/rgw_rest_s3.cc 2024-05-17 19:45:54.373135874 +0000
24+
@@ -2661,10 +2661,6 @@
25+
26+
map_qs_metadata(s);
27+
28+
- ldpp_dout(this, 20) << "adding bucket to policy env: " << s->bucket->get_name()
29+
- << dendl;
30+
- env.add_var("bucket", s->bucket->get_name());
31+
-
32+
bool done;
33+
do {
34+
struct post_form_part part;
35+
@@ -2715,6 +2711,10 @@
36+
env.add_var(part.name, part_str);
37+
} while (!done);
38+
39+
+ ldpp_dout(this, 20) << "adding bucket to policy env: " << s->bucket->get_name()
40+
+ << dendl;
41+
+ env.add_var("bucket", s->bucket->get_name());
42+
+
43+
string object_str;
44+
if (!part_str(parts, "key", &object_str)) {
45+
err_msg = "Key not specified";

SPECS/ceph/ceph.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Summary: User space components of the Ceph file system
66
Name: ceph
77
Version: 16.2.10
8-
Release: 3%{?dist}
8+
Release: 4%{?dist}
99
License: LGPLv2 and LGPLv3 and CC-BY-SA and GPLv2 and Boost and BSD and MIT and Public Domain and GPLv3 and ASL-2.0
1010
URL: https://ceph.io/
1111
Vendor: Microsoft Corporation
@@ -15,6 +15,7 @@ Patch0: CVE-2021-24032.patch
1515
Patch1: CVE-2021-28361.patch
1616
Patch2: CVE-2022-3650.patch
1717
Patch3: CVE-2022-3854.patch
18+
Patch4: CVE-2023-43040.patch
1819

1920
#
2021
# Copyright (C) 2004-2019 The Ceph Project Developers. See COPYING file
@@ -1809,6 +1810,9 @@ exit 0
18091810
%config %{_sysconfdir}/prometheus/ceph/ceph_default_alerts.yml
18101811

18111812
%changelog
1813+
* Fri May 17 2024 Henry Beberman <henry.beberman@microsoft.com> - 16.2.10-4
1814+
- Patch CVE-2023-43040
1815+
18121816
* Fri May 10 2024 Henry Beberman <henry.beberman@microsoft.com> - 16.2.10-3
18131817
- Patch CVE-2021-24032, CVE-2021-28361, CVE-2022-3650, CVE-2022-3854
18141818
- Explicitly disable seastar to ensure disputed uncompiled CVEs dont get enabled.

0 commit comments

Comments
 (0)