Security mailing lists by PureSourceCode

CVE-2023-41039

HIGH 7.7CVSS 3.1

Sandbox escape via various forms of "format".

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.

Published
30 Aug 2023
Last modified
17 Jun 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-74
Also known as
GHSA-xjw2-6jm9-rf67PYSEC-2023-159
Sources
NVDJSONOSV GHSA-xjw2-6jm9-rf67JSONOSV PYSEC-2023-159JSON

Scores

SourceScored byVersionScoreVector / decision
NVD security-advisories@github.com (Secondary) CVSS 3.1 HIGH 8.3 CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:L
OSV GitHub CVSS 3.1 HIGH 8.3 CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:L
NVD nvd@nist.gov (Primary) CVSS 3.1 HIGH 7.7 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
OSV PyPA CVSS 3.1 HIGH 7.7 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD zope restrictedpython
cpe:2.3:a:zope:restrictedpython:*:*:*:*:*:*:*:*
< 5.4 5.4
NVD zope restrictedpython
cpe:2.3:a:zope:restrictedpython:*:*:*:*:*:*:*:*
>= 6.0, < 6.2 6.2
OSV PyPI restrictedpython < 5.4 5.4
OSV PyPI restrictedpython >= 6.0, < 6.2 6.2
OSV PyPI restrictedpython >= 6.0, < 6.2; < 5.4 6.2, 5.4

References

History

  • 25 Nov 2026 20:36 UTC · NVD: first stored (published 30 Aug 2023)
  • 25 Nov 2026 20:12 UTC · OSV: first stored (published 30 Aug 2023)
  • 25 Nov 2026 20:12 UTC · OSV: first stored (published 30 Aug 2023)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.