CVE-2023-41039 Sandbox escape via various forms of "format" in RestrictedPython
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: total
- Technology
- UbuntuDebian
Description
RestrictedPython is a restricted execution environment for Python to run untrusted code. Python's "format" functionality allows someone controlling the format string to "read" all objects accessible through recursive attribute lookup and subscription from objects he can access. This can lead to critical information disclosure. With RestrictedPython, the format functionality is available via the format and format_map methods of str (and unicode) (accessed either via the class or its instances) and via string.Formatter. All known versions of RestrictedPython are vulnerable. This issue has been addressed in commit 4134aedcff1 which has been included in the 5.4 and 6.2 releases. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Upgrade path
9 packages: 7 fixed, 1 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/restrictedpython(Debian 12) | = 4.0~b3-3; = 6.2-1; = 8.0-1; = 8.1-1 +2 more | No fix listed | No fix yet |
| debian/restrictedpython(Debian 13) | < 6.2-1 | 6.2-1 | Fixed |
| debian/restrictedpython(Debian 14) | < 6.2-1 | 6.2-1 | Fixed |
| pypi restrictedpython(PyPI) | < 5.4; <= 5.3; = 3.4.2; = 3.4.3 +27 more | 5.4, 6.2 | Fixed |
| ubuntu/restrictedpython(Ubuntu 22.04) | < 4.0~b3-3ubuntu0.1~esm1 | 4.0~b3-3ubuntu0.1~esm1 | Fixed |
| ubuntu/restrictedpython(Ubuntu Pro 20.04) | < 4.0~b3-2ubuntu0.1~esm1; = 4.0~b3-2 | 4.0~b3-2ubuntu0.1~esm1 | Fixed |
| ubuntu/restrictedpython(Ubuntu Pro 22.04) | < 4.0~b3-3ubuntu0.1~esm1; = 4.0~b3-2; = 4.0~b3-2ubuntu1; = 4.0~b3-3 | 4.0~b3-3ubuntu0.1~esm1 | Fixed |
| zope restrictedpython | < 5.4; >= 6.0, < 6.2 | 5.4, 6.2 | Fixed |
| zopefoundation RestrictedPython | = < 5.4; = >= 6.0, < 6.1 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi restrictedpython(PyPI) | < 5.4 | 5.4 |
| pypi restrictedpython(PyPI) | = 3.4.2 | No fix listed |
| pypi restrictedpython(PyPI) | = 3.4.3 | No fix listed |
| pypi restrictedpython(PyPI) | = 3.5.0 | No fix listed |
| pypi restrictedpython(PyPI) | = 3.5.1 | No fix listed |
| pypi restrictedpython(PyPI) | = 3.5.2 | No fix listed |
| pypi restrictedpython(PyPI) | = 3.6.0 | No fix listed |
| pypi restrictedpython(PyPI) | = 3.6.0a1 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0a1 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0a2 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0a3 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0b1 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0b2 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0b3 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0b4 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0b5 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0b6 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0b7 | No fix listed |
| pypi restrictedpython(PyPI) | = 4.0b8 | No fix listed |
| pypi restrictedpython(PyPI) | = 5.0 | No fix listed |
| pypi restrictedpython(PyPI) | = 5.1 | No fix listed |
| pypi restrictedpython(PyPI) | = 5.2 | No fix listed |
| pypi restrictedpython(PyPI) | = 5.2a1.dev0 | No fix listed |
| pypi restrictedpython(PyPI) | = 5.3 | No fix listed |
Show 25 more
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi restrictedpython(PyPI) | = 5.3a1.dev0 | No fix listed |
| pypi restrictedpython(PyPI) | >= 6.0, < 6.2 | 6.2 |
| pypi restrictedpython(PyPI) | = 6.0 | No fix listed |
| pypi restrictedpython(PyPI) | = 6.1 | No fix listed |
| pypi restrictedpython(PyPI) | <= 5.3 | No fix listed |
| pypi restrictedpython(PyPI) | >= 6.0, <= 6.1 | No fix listed |
| debian/restrictedpython(Debian:12) | All versions | No fix listed |
| debian/restrictedpython(Debian:12) | = 4.0~b3-3 | No fix listed |
| debian/restrictedpython(Debian:12) | = 6.2-1 | No fix listed |
| debian/restrictedpython(Debian:12) | = 8.0-1 | No fix listed |
| debian/restrictedpython(Debian:12) | = 8.1-1 | No fix listed |
| debian/restrictedpython(Debian:12) | = 8.4-1 | No fix listed |
| debian/restrictedpython(Debian:13) | < 6.2-1 | 6.2-1 |
| debian/restrictedpython(Debian:14) | < 6.2-1 | 6.2-1 |
| zopefoundation RestrictedPython | = < 5.4 | No fix listed |
| zopefoundation RestrictedPython | = >= 6.0, < 6.1 | No fix listed |
| ubuntu/restrictedpython(Ubuntu:22.04) | < 4.0~b3-3ubuntu0.1~esm1 | 4.0~b3-3ubuntu0.1~esm1 |
| zope restrictedpython | < 5.4 | 5.4 |
| zope restrictedpython | >= 6.0, < 6.2 | 6.2 |
| ubuntu/restrictedpython(Ubuntu:Pro:20.04) | < 4.0~b3-2ubuntu0.1~esm1 | 4.0~b3-2ubuntu0.1~esm1 |
| ubuntu/restrictedpython(Ubuntu:Pro:20.04) | = 4.0~b3-2 | No fix listed |
| ubuntu/restrictedpython(Ubuntu:Pro:22.04) | < 4.0~b3-3ubuntu0.1~esm1 | 4.0~b3-3ubuntu0.1~esm1 |
| ubuntu/restrictedpython(Ubuntu:Pro:22.04) | = 4.0~b3-2 | No fix listed |
| ubuntu/restrictedpython(Ubuntu:Pro:22.04) | = 4.0~b3-2ubuntu1 | No fix listed |
| ubuntu/restrictedpython(Ubuntu:Pro:22.04) | = 4.0~b3-3 | No fix listed |
References
- https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67 issue-tracking vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- https://github.com/zopefoundation/RestrictedPython/commit/4134aedcff17c977da7717693ed89ce56d54c120 issue-tracking patch
- github.com product
- github.com
- Debian Security Tracker CVE-2023-41039 vendor-advisory
- Ubuntu CVE tracker issue-tracking vendor-advisory
- USN-7355-1 vendor-advisory
- www.cve.org issue-tracking