patchminder
No public exploit found CVE-2023-37271

Code executionin zopefoundation RestrictedPython.

Published 11 Jul 2023 · Updated 7 Nov 2024 · Every fact sourced

JSONCite
Is it exploited?
Not confirmed

No public exploit found; not on exploited lists.

Severity
High 8.4
CVSSA severity score from 0 to 10. 9 and higher is critical. 3.1
Attack likelihood
Low
EPSSA daily score from FIRST: the chance a hole is attacked in the next 30 days. 0.8% chance in 30 days · 4 Dec 2026
Fix
Available
Fixed in 5.3, 6.1
In plain words

RestrictedPython is a tool that helps to define a subset of the Python language which allows users to provide a program input into a trusted environment. RestrictedPython does not check access to stack frames and their attributes. Stack frames are accessible within at least generators and generator expressions, which are allowed inside RestrictedPython. Prior to versions 6.1 and 5.3, an attacker with access to a RestrictedPython environment can write code that gets the current stack frame in a generator and then walk the stack all the way beyond the RestrictedPython invocation boundary, thus breaking out of the restricted sandbox and potentially allowing arbitrary code execution in the Python interpreter.

What to do now
  • Upgrade RestrictedPython to 5.3, 6.1 or later, whichever matches your release line.
  • Upgrade RestrictedPython (PyPI) to 5.3, 6.1 or later, whichever matches your release line.
  • Upgrade restrictedpython (PyPI) to 5.3 or later.
Versions

Affected and fixed versions

Product or package
Affected
Fixed in
Source
RestrictedPython
6.0a1.dev0 to before 6.1
6.1
CVE record
RestrictedPython
before 5.3
5.3
CVE record
RestrictedPython (PyPI)
before 5.3
5.3
GitHub advisory
RestrictedPython (PyPI)
6.0a1.dev0 to before 6.1
6.1
GitHub advisory
restrictedpython (PyPI)
before 5.3
5.3
GitHub advisory

From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.

Timeline

From first report to first attacks

  1. 29 Jun 2023
    CVE ID reserved by GitHub_M.
  2. 11 Jul 2023
    Published in the CVE List.
  3. 7 Nov 2024
    CVE record last updated.
Exploit code

Attack code anyone can find

Exploit maturity: No public exploit found. CISA assessment (SSVC): exploitation none.

Metasploit module
None known
Nuclei scan template
None known
Exploit-DB
None known
GitHub proof of concepts
None known

Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.

Related

Other RestrictedPython vulnerabilities

Same weakness: Improper control of dynamic code resources

All CWE-913 vulnerabilities

References
Cite this page

Patchminder. CVE-2023-37271: Code execution in zopefoundation RestrictedPython. https://patchminder.com/cve/cve-2023-37271/ (accessed 5 December 2026).