rgw: check for tagging element in POST Obj requests
authorAbhishek Lekshmanan <abhishek@suse.com>
Wed, 22 Apr 2020 09:24:34 +0000 (11:24 +0200)
committerBastien Roucariès <rouca@debian.org>
Sat, 21 Oct 2023 16:42:26 +0000 (17:42 +0100)
Check for null element when reading the tagging field from POST obj XML

Fixes: https://tracker.ceph.com/issues/44967
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
Origin: upstream, https://github.com/ceph/ceph/pull/34715

Gbp-Pq: Name CVE-2020-12059.patch

src/rgw/rgw_rest_s3.cc

index eb51e7536f3f0e495b949268875368d40f42104f..2a935f0997abb3933858d943cb624dd989a743b3 100644 (file)
@@ -1725,6 +1725,9 @@ int RGWPostObj_ObjStore_S3::get_tags()
     RGWObjTagging_S3 *tagging;
 
     tagging = static_cast<RGWObjTagging_S3 *>(parser.find_first("Tagging"));
+    if (!tagging) {
+      return -ERR_MALFORMED_XML;
+    }
     obj_tags_s3 = static_cast<RGWObjTagSet_S3 *>(tagging->find_first("TagSet"));
     if(!obj_tags_s3){
       return -ERR_MALFORMED_XML;