]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: Fix bucket validation against POST policies 53757/head
authorJoshua Baergen <jbaergen@digitalocean.com>
Wed, 17 May 2023 18:17:09 +0000 (12:17 -0600)
committerCasey Bodley <cbodley@redhat.com>
Mon, 2 Oct 2023 19:49:00 +0000 (15:49 -0400)
commitc940d3818da37a5bcfc58299c4e611c311caf76f
tree626f4ec322de63c86caf5885208a722925d4557f
parent987fa95080ba82385f45e0889919cddc5e2645b0
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.

Fixes: https://tracker.ceph.com/issues/63004
Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
(cherry picked from commit 98bfb71cb38899333deb58dd2562037450fd7fa8)
src/rgw/rgw_rest_s3.cc