{"cve":"CVE-2023-41039","nvd":{"published":"2023-08-30T18:15:09.880","modified":"2026-06-17T06:20:13.893","status":"Modified","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7},"cwes":["CWE-74"],"references":["https://github.com/zopefoundation/RestrictedPython/commit/4134aedcff17c977da7717693ed89ce56d54c120","https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67","https://github.com/zopefoundation/RestrictedPython/commit/4134aedcff17c977da7717693ed89ce56d54c120","https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-xjw2-6jm9-rf67"],"products":["zope:restrictedpython"],"source":"nvd","synced_at":"2026-10-19T21:39:14.809778102+00:00"},"epss":{"cve":"CVE-2023-41039","score":0.00683,"percentile":0.52533,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-xjw2-6jm9-rf67","url":"https://osv.dev/vulnerability/GHSA-xjw2-6jm9-rf67","summary":"Sandbox escape via various forms of \"format\".","modified":"2024-02-16T08:18:58.766349Z","packages":[{"ecosystem":"PyPI","name":"restrictedpython","purl":"pkg:pypi/restrictedpython","ranges":["<5.4"],"fixed":["5.4"]},{"ecosystem":"PyPI","name":"restrictedpython","purl":"pkg:pypi/restrictedpython","ranges":[">=6.0 <6.2"],"fixed":["6.2"]}]},{"id":"PYSEC-2023-159","url":"https://osv.dev/vulnerability/PYSEC-2023-159","summary":"","modified":"2023-11-08T04:13:23.394567Z","packages":[{"ecosystem":"PyPI","name":"restrictedpython","purl":"pkg:pypi/restrictedpython","ranges":[">=6.0 <6.2","<5.4"],"fixed":["6.2","5.4"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}