CVE-2023-37271
HIGHDescription
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. All RestrictedPython deployments that allow untrusted users to write Python code in the RestrictedPython environment are at risk. In terms of Zope and Plone, this would mean deployments where the administrator allows untrusted users to create and/or edit objects of type `Script (Python)`, `DTML Method`, `DTML Document` or `Zope Page Template`. This is a non-default configuration and likely to be extremely rare. The problem has been fixed in versions 6.1 and 5.3.
How to fix
TridentStack Control can deploy fixes like this automatically across your Windows, macOS, and Linux fleet. See how it works
Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.
CVSS v3 Vector
Exploitability
Impact
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L
Exploit Intelligence
Moderate risk: more likely to be exploited than 55% of all known CVEs.
References
Related Vulnerabilities
Other CWE-913 vulnerabilities, ordered by exploit likelihood. View all
| CVE | Severity | CVSS | EPSS | Exploited | Fix |
|---|---|---|---|---|---|
| CVE-2025-68613 | Critical | 9.9 | 98% | KEV | Fix |
| CVE-2023-50386 | High | 8.8 | 84% | - | Fix |
| CVE-2023-43177 | Critical | 9.8 | 82% | - | Fix |
| CVE-2023-29017 | Critical | 10.0 | 63% | - | Fix |
| CVE-2022-36067 | Critical | 10.0 | 48% | - | Fix |
| CVE-2023-6184 | Medium | 5.0 | 47% | - | - |
Common questions
How do I fix CVE-2023-37271?
Published advisories record a fix for 3 affected products. The "How to fix" section on this page lists the fixed version and source advisory for each one, so apply the entry matching what you actually run.
Is CVE-2023-37271 being actively exploited?
Not that we know of. CVE-2023-37271 is not in the CISA Known Exploited Vulnerabilities catalog. Its EPSS score of 0.85% is the estimated probability that it will be exploited in the next 30 days. That is higher than 55% of all scored CVEs.
How severe is CVE-2023-37271?
CVE-2023-37271 has a CVSS v3 base score of 8.4, rated high. CVSS rates the technical impact if the vulnerability is exploited, not how likely that is, so weigh it alongside the exploit-prediction score when you decide what to patch first.
What does CVE-2023-37271 affect?
Published advisories record a fix for restrictedpython (Debian), python3-restrictedpython (Ubuntu), restrictedpython (Ubuntu). Only products with a sourced advisory are listed, so treat this as what we can cite rather than a complete inventory.
Embed a live status badge for CVE-2023-37271
Markdown
[](https://tridentstack.com/cve/CVE-2023-37271)HTML
<a href="https://tridentstack.com/cve/CVE-2023-37271"><img src="https://tridentstack.com/cve/badge/CVE-2023-37271.svg" alt="CVE-2023-37271"></a>Find and fix vulnerabilities across your fleet
TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.
This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2024-11-21.