CVE-2022-47950: Swift OpenStack Swift XML External Entities Vulnerability
MODERATECVE-2022-47950 is a MODERATE (CVSS 6.5) openstack swift xml external entities vulnerability (CWE-552: Files or Directories Accessible to External Parties) affecting Swift libraries in the PyPI ecosystem. The issue involves openstack swift xml external entities (xxe) injection. Remediation is available by upgrading affected packages to version 2.28.1, 2.29.2, 2.30.1.
CVE-2022-47950 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2022-47950
To remediate this vulnerability, upgrade all affected Swift dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install swift>=2.28.1
pip install swift>=2.29.2
pip install swift>=2.30.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show swift
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-47950, inspect your installed packages using pip:
pip show swift
Analyze the terminal output to locate any version of Swift in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.28.1), your application is affected.
Note: The pip show swift command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-552: Files or Directories Accessible to External Parties, where the product makes files or directories accessible to unauthorized actors, even though they should not be. In Swift, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-47950 Affected Swift Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
swift
|
PyPI |
< 2.28.1
|
2.28.1
|
|
swift
|
PyPI |
≥ 2.29.0
< 2.29.2
|
2.29.2
|
|
swift
|
PyPI |
≥ 2.30.0
< 2.30.1
All 1 versions
2.30.0
|
2.30.1
|
References
Frequently Asked Questions
What is CVE-2022-47950?
Which Swift versions are affected?
What version fixes CVE-2022-47950?
Is swift affected?
What is the CVSS score of CVE-2022-47950?
What CWE is associated with CVE-2022-47950?
How can I check PyPI dependencies for CVE-2022-47950?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-274c-rx2j-2v3x",
"modified" : "2025-04-04T19:35:40Z",
"published" : "2023-01-18T18:30:16Z",
"aliases" : [ "CVE-2022-47950" ],
"summary" : "OpenStack Swift XML external entities (XXE) Injection",
"details" : "An issue was discovered in OpenStack Swift before 2.28.1, 2.29.x before 2.29.2, and 2.30.0. By supplying crafted XML files, an authenticated user may coerce the S3 API into returning arbitrary file contents from the host server, resulting in unauthorized read access to potentially sensitive data. This impacts both s3api deployments (Rocky or later), and swift3 deployments (Queens and earlier, no longer actively developed).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "swift"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.28.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "swift"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.29.0"
}, {
"fixed" : "2.29.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "swift"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.30.0"
}, {
"fixed" : "2.30.1"
} ]
} ],
"versions" : [ "2.30.0" ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-47950"
}, {
"type" : "WEB",
"url" : "https://github.com/openstack/swift/commit/12e54391861e7d182d58f89fb88b027e65842640"
}, {
"type" : "WEB",
"url" : "https://github.com/openstack/swift/commit/7d13d1a82e1f5d01205a13184907501b4fcbe2b0"
}, {
"type" : "WEB",
"url" : "https://github.com/openstack/swift/commit/8dd96470a859dc7b189404fb67bd3899ae9c617f"
}, {
"type" : "WEB",
"url" : "https://github.com/openstack/swift/commit/b8467e190f6fc67fd8fb6a8c5e32b2aa6a10fd8e"
}, {
"type" : "WEB",
"url" : "https://github.com/openstack/swift/commit/baa98848451b5c234443a068691e12841a5a8383"
}, {
"type" : "WEB",
"url" : "https://github.com/openstack/swift/commit/c834e7a53d5a33a3fd13ffd954e6f4f4ee953dfc"
}, {
"type" : "WEB",
"url" : "https://github.com/openstack/swift/commit/d8d04ef43c90079d436b2e49617b4425ba39c28e"
}, {
"type" : "WEB",
"url" : "https://github.com/openstack/swift/commit/f10672514217adadfc776d9ea2ffb20a37ce073b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/openstack/swift"
}, {
"type" : "WEB",
"url" : "https://launchpad.net/bugs/1998625"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/01/msg00021.html"
}, {
"type" : "WEB",
"url" : "https://security.openstack.org/ossa/OSSA-2023-001.html"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2023/dsa-5327"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-552", "CWE-611" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-14T21:30:33Z",
"nvd_published_at" : "2023-01-18T17:15:00Z"
}
}