CVE-2023-43040 rgw: Fix bucket validation against POST policies
authorJoshua Baergen <jbaergen@digitalocean.com>
Wed, 17 May 2023 18:17:09 +0000 (12:17 -0600)
committerChris Lamb <lamby@debian.org>
Fri, 6 Feb 2026 19:24:31 +0000 (11:24 -0800)
commit2bf7ed07cccdd6c7ad6d9eb8fff07442fdc7a14c
tree1e6eb728b66b7ee6c56ef0a3b88ed1beddc8a127
parente56844400b5452c6deda24d62c1f9532c9178f34
CVE-2023-43040 rgw: Fix bucket validation against POST policies

It's possible that user could provide a form part as a part of a POST
object upload that uses 'bucket' as a key; in this case, it was
overriding what was being set in the validation env (which is the real
bucket being modified). The result of this is that a user could actually
upload to any bucket accessible by the specified access key by matching
the bucket in the POST policy in said POST form part.

Fix this simply by setting the bucket to the correct value after the
POST form parts are processed, ignoring the form part above if
specified.

bug: https://tracker.ceph.com/issues/63004
bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053690
bug-debian-security: https://deb.freexian.com/extended-lts/tracker/CVE-2023-43040

Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
origin: backport, https://github.com/ceph/ceph/commit/479976538fe8f51edfea597443ba0c0209d3f39f

Gbp-Pq: Name CVE-2023-43040.patch
src/rgw/rgw_rest_s3.cc