CVE-2023-41039
published 2023-08-30CVE-2023-41039: RestrictedPython is a restricted execution environment for Python to run untrusted code. Python's "format" functionality allows someone controlling the format…
PriorityP343high7.7CVSS 3.1
AVNACLPRLUINSCCHINAN
EPSS
0.64%
45.9th percentile
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.
Affected
12 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | restrictedpython | < restrictedpython 6.2-1 (forky) | restrictedpython 6.2-1 (forky) |
| zope | restrictedpython | < 5.4 | 5.4 |
| zope | restrictedpython | >= 6.0 < 6.2 | 6.2 |
| zopefoundation | restrictedpython | < 5.4 | 5.4 |
| zopefoundation | restrictedpython | — | — |
| zopefoundation | restrictedpython | >= 0 < 6.2-1 | 6.2-1 |
| zopefoundation | restrictedpython | >= 0 < 6.2-1 | 6.2-1 |
| zopefoundation | restrictedpython | >= 0 < 5.4 | 5.4 |
| zopefoundation | restrictedpython | >= 0 < 4.0~b3-2ubuntu0.1~esm1 | 4.0~b3-2ubuntu0.1~esm1 |
| zopefoundation | restrictedpython | >= 0 < 4.0~b3-3ubuntu0.1~esm1 | 4.0~b3-3ubuntu0.1~esm1 |
| zopefoundation | restrictedpython | >= 0 < 6.2-1ubuntu0.24.04.1~esm1 | 6.2-1ubuntu0.24.04.1~esm1 |
| zopefoundation | restrictedpython | >= 6.0 < 6.2 | 6.2 |
CVSS provenance
nvdv3.17.7HIGHCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
osv9.9CRITICAL
vendor_ubuntu8.4HIGH
vendor_debian8.3HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
restrictedpython vulnerabilities
osv·2025-03-18·CVSS 9.9
CVE-2023-37271 [CRITICAL] restrictedpython vulnerabilities
restrictedpython vulnerabilities
Nakul Choudhary and Robert Xiao discovered that RestrictedPython did not
properly sanitize certain inputs. An attacker could possibly use this
issue to execute arbitrary code. This issue only affected
Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2023-37271)
Abhishek Govindarasu, Ankush Menat and Ward Theunisse discovered that
RestrictedPython did not correctly handle certain format strings. An
attacker could possibly use this issue to leak sensitive information.
This issue only affected Ubuntu 20.04 LTS and Ubuntu 22.04 LTS.
(CVE-2023-41039)
It was discovered that RestrictedPython did not correctly restrict access
to certain fields. An attacker could possibly use this issue to leak
sensitive information. (CVE-2024-47532)
It was discovered that Restricted
OSV
Sandbox escape via various forms of "format".
osv·2023-08-30
CVE-2023-41039 [HIGH] Sandbox escape via various forms of "format".
Sandbox escape via various forms of "format".
### Impact
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.
### Patches
The issue will be fixed in 5.4 and 6.2.
### Workarounds
There are no workarounds to fix the issue without upgrading.
### References
* https://docs.python.org/3/library/stdtypes.html#str.format_map
* http://lucumr.pocoo.org/
OSV
CVE-2023-41039: RestrictedPython is a restricted execution environment for Python to run untrusted code
osv·2023-08-30·CVSS 7.7
CVE-2023-41039 [HIGH] CVE-2023-41039: RestrictedPython is a restricted execution environment for Python to run untrusted code
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.
GHSA
Sandbox escape via various forms of "format".
ghsa·2023-08-30
CVE-2023-41039 [HIGH] CWE-74 Sandbox escape via various forms of "format".
Sandbox escape via various forms of "format".
### Impact
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.
### Patches
The issue will be fixed in 5.4 and 6.2.
### Workarounds
There are no workarounds to fix the issue without upgrading.
### References
* https://docs.python.org/3/library/stdtypes.html#str.format_map
* http://lucumr.pocoo.org/
Ubuntu
RestrictedPython vulnerabilities
vendor_ubuntu·2025-03-18·CVSS 8.4
CVE-2023-37271 [HIGH] RestrictedPython vulnerabilities
Title: RestrictedPython vulnerabilities
Summary: Several security issues were fixed in RestrictedPython.
Nakul Choudhary and Robert Xiao discovered that RestrictedPython did not
properly sanitize certain inputs. An attacker could possibly use this
issue to execute arbitrary code. This issue only affected
Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2023-37271)
Abhishek Govindarasu, Ankush Menat and Ward Theunisse discovered that
RestrictedPython did not correctly handle certain format strings. An
attacker could possibly use this issue to leak sensitive information.
This issue only affected Ubuntu 20.04 LTS and Ubuntu 22.04 LTS.
(CVE-2023-41039)
It was discovered that RestrictedPython did not correctly restrict access
to certain fields. An attacker could possibly use this issue to leak
s
Debian
CVE-2023-41039: restrictedpython - RestrictedPython is a restricted execution environment for Python to run untrust...
vendor_debian·2023·CVSS 8.3
CVE-2023-41039 [HIGH] CVE-2023-41039: restrictedpython - RestrictedPython is a restricted execution environment for Python to run untrust...
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.
Scope: local
bo
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://github.com/zopefoundation/RestrictedPython/commit/4134aedcff17c977da7717693ed89ce56d54c120https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67https://github.com/zopefoundation/RestrictedPython/commit/4134aedcff17c977da7717693ed89ce56d54c120https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67
2023-08-30
Published