CVE-2023-41039Sandbox escape via various forms of "format" in RestrictedPython
- 8.3HighCVSS base score
- 0.68%Exploitation in 30 daysEPSS · top 47% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
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.
Timeline
ID reserved
By GitHub_M
- 8 days later
· 8 days later
Published
- 13 months later
· 13 months later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | High8.3 | CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:L |
| NVDNVD · Modified | 3.1 | High7.7 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N |
- EPSS (exploitation in 30 days)
- 0.68% · top 47% of all CVEs (19 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 8.3.
Affected products
zopefoundation · RestrictedPython
- affected < 5.4
- affected >= 6.0, < 6.1
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- PyPIRestrictedPythonGHSA-xjw2-6jm9-rf67 (opens in a new tab)
References
References2
- https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67 (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://github.com/zopefoundation/RestrictedPython/commit/4134aedcff17c977da7717693ed89ce56d54c120 (opens in a new tab)x_refsource_MISCx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2023-0229 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-xjw2-6jm9-rf67 (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2023-41039)Record last updated .