Skip to content

Commit e416427

Browse files
committed
rgw: return MalformedXML for empty objects list in DeleteObjects
When a request contains an empty list of objects, the current implementation returns a 200 OK. However, this behavior may raise security concerns, as it could imply the user has access to the bucket, even though access policies are only evaluated per object. To mitigate this risk, returning a 400 Bad Request would be a more secure approach. This ensures that no assumption is made about the user’s access to the bucket or its objects. Furthermore, this adjustment aligns with AWS behavior, enhancing compatibility. Fixes: https://tracker.ceph.com/issues/68799 Signed-off-by: Seena Fallah <[email protected]>
1 parent 7f9a2ec commit e416427

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/rgw/rgw_op.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7319,6 +7319,12 @@ void RGWDeleteMultiObj::execute(optional_yield y)
73197319
return;
73207320
}
73217321

7322+
if (multi_delete->objects.empty()) {
7323+
s->err.message = "Missing required element Object";
7324+
op_ret = -ERR_MALFORMED_XML;
7325+
return;
7326+
}
7327+
73227328
constexpr int DEFAULT_MAX_NUM = 1000;
73237329
int max_num = s->cct->_conf->rgw_delete_multi_obj_max_num;
73247330
if (max_num < 0) {

0 commit comments

Comments
 (0)