cve.bz

CVE-2023-37271 zope restrictedpython

9.9 criticalEPSS 0.8%Fix available

Critical (9.9) in zope restrictedpython. EPSS 0.8% estimated probability of exploitation activity in the next 30 days. Fixed in restrictedpython 5.3, 6.1.

On this page
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.

Severity

CVSS 3.1

9.9 critical
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
EPSS
0.8% (unchanged from 0.8% a week ago; 0.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 59th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2024-11-07. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-913 Improper Control of Dynamically-Managed Code Resources
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2023-37271 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2023-37271?via=ask-ai-copy and https://cve.bz/cve/CVE-2023-37271?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2023-37271 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
zope:restrictedpythonbefore 5.3
zope:restrictedpython6.0
zope:restrictedpython6.0:a1.dev0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-wqc8-x2pr-7jqhPyPIrestrictedpython<5.35.3
GHSA-wqc8-x2pr-7jqhPyPIrestrictedpython>=6.0a1.dev0 <6.16.1
GHSA-wqc8-x2pr-7jqhPyPIrestrictedpython<5.35.3
PYSEC-2023-118PyPIrestrictedpython<5.35.3

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12restrictedpythonno fix listedDEBIAN-CVE-2023-37271
Debian13, 14restrictedpython6.2-1DEBIAN-CVE-2023-37271
UbuntuPro:20.04:LTSrestrictedpython4.0~b3-2ubuntu0.1~esm1UBUNTU-CVE-2023-37271 USN-7355-1
UbuntuPro:22.04:LTSrestrictedpython4.0~b3-3ubuntu0.1~esm1UBUNTU-CVE-2023-37271 USN-7355-1
UbuntuPro:24.04:LTSrestrictedpython6.2-1ubuntu0.24.04.1~esm1USN-7355-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu.

References

Check your stackJSON