CVE & CISA-KEV Catalog

CVE-2023-37271

HIGH
8.4
CVSS v3
NVD

Description

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

Remediation Available
restrictedpythonDebian
Fixed in:6.2-1CVE-2023-37271
Fixed in:6.2-1CVE-2023-37271
restrictedpythonPyPI (Python)
python3-restrictedpythonUbuntu
Fixed in:4.0~b3-2ubuntu0.1~esm1USN-7355-1

This Ubuntu release reached end-of-life on 2025-05-31. Extended security maintenance is available until 2030-04-02.

Fixed in:4.0~b3-3ubuntu0.1~esm1USN-7355-1
Fixed in:6.2-1ubuntu0.24.04.1~esm1USN-7355-1
restrictedpythonUbuntu
Fixed in:4.0~b3-2ubuntu0.1~esm1USN-7355-1

This Ubuntu release reached end-of-life on 2025-05-31. Extended security maintenance is available until 2030-04-02.

Fixed in:4.0~b3-3ubuntu0.1~esm1USN-7355-1
Fixed in:6.2-1ubuntu0.24.04.1~esm1USN-7355-1

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

Attack VectorNetwork
Attack ComplexityHigh
Privileges RequiredLow
User InteractionNone
ScopeChanged

Impact

ConfidentialityHigh
IntegrityHigh
AvailabilityLow

CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L

Exploit Intelligence

0.85%probability of exploitation in 30 days
56thpercentile

Moderate risk: more likely to be exploited than 56% of all known CVEs.

References

Vendor Advisory1

Related Vulnerabilities

Other CWE-913 vulnerabilities, ordered by exploit likelihood. View all

CVESeverityCVSSEPSSExploitedFix
CVE-2025-68613Critical9.999%KEVFix
CVE-2023-50386High8.884%-Fix
CVE-2023-43177Critical9.882%-Fix
CVE-2023-29017Critical10.063%-Fix
CVE-2022-36067Critical10.048%-Fix
CVE-2023-6184Medium5.047%--

Common questions

How do I fix CVE-2023-37271?

Published advisories record a fix for 4 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 56% 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), restrictedpython (PyPI (Python)), 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
CVE-2023-37271 severity badge

Markdown

[![CVE-2023-37271](https://tridentstack.com/cve/badge/CVE-2023-37271.svg)](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>

Check your Linux endpoints for this class of vulnerability

TridentStack Control continuously scans Linux endpoints for known vulnerabilities and deploys the fixes from the same console. 200 endpoints free forever, no credit card.

Patch your fleet freeStart freeThis CVE lookup is free and always will be.

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 2026-06-17.