Cyber Resilience

CVE-2023-37271

Zope Restrictedpython ≤ 5.3

Published
11 July 2023
Modified
21 November 2024
Patch / advisory
CVSS Score v3.1 8.4
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L
EPSS Score 0.0085 55th percentile
Risk Priority 60 floored blend · peak EPSS

Summary

CVE-2023-37271 is a high-severity Improper Control of Dynamically-Managed Code Resources (CWE-913) vulnerability in Zope Restrictedpython. Its CVSS base score is 8.4 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Reflective Code Loading (T1620); ranked in the top 45% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1620 Reflective Code Loading Stealth
Adversaries may reflectively load code into a process in order to conceal the execution of malicious payloads.
T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1059.007 JavaScript Execution
Adversaries may abuse various implementations of JavaScript for execution.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
T1059.006 Python Execution
Adversaries may abuse Python commands and scripts for execution.
T1059.011 Lua Execution
Adversaries may abuse Lua commands and scripts for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2023-41039Same product: Zope Restrictedpython
CVE-2024-47532Same product: Zope Restrictedpython
CVE-2026-47208Shared CWE-913
CVE-2026-47210Shared CWE-913
CVE-2026-33286Shared CWE-913
CVE-2025-68613Shared CWE-913
CVE-2024-5401Shared CWE-913
CVE-2023-29017Shared CWE-913
CVE-2025-6384Shared CWE-913
CVE-2025-54065Shared CWE-913

Affected Assets

zope
restrictedpython
6.0 · ≤ 5.3

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)
  • 2 hardening rules · 2 OS baselines
Validate
Prove the fix (OWASP ASVS)

Likely Mitigating Controls AI

Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.

addresses: CWE-913

Requiring explicit authorization and ongoing control of mobile code implements proper management of dynamically loaded code resources.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 full match
prevents

Secure SDLC practices explicitly include controls that prevent improper handling of dynamic code resources.

PR.PS-05 mostly match
prevents

Blocking unauthorized code execution directly limits the ability to abuse dynamically-managed resources.

DE.CM-09 partial match
prevents

Runtime-environment monitoring can detect exploitation of the weakness but does not prevent it.

ID.RA-01 partial match
prevents

Vulnerability identification can surface instances of CWE-913 but does not mitigate the root weakness.

PR.PS-01 partial match
prevents

Hardened configuration baselines can restrict dynamic code execution and variable access at runtime.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing can detect dynamic code weaknesses but does not prevent them at design or coding time.

prevents

Secure development lifecycle mandates controls on dynamic code generation and resource management.

prevents

Application security requirements explicitly address restrictions on dynamic code execution and resource access.

prevents

Secure architecture principles require design controls that prevent improper dynamic code resource manipulation.

prevents

Secure coding standards directly prohibit unsafe dynamic code resource handling and injection patterns.

none

Environment separation reduces exposure of dynamic code resources but does not address the underlying weakness.

Hardening callouts derived

Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over `controls_xwalks` (authoritative rows only; rows rated `none` are excluded).

Windows 10 (1 rule)
  • V-220726 Data Execution Prevention (DEP) must be configured to at least OptOut. prevents CWE-913
Windows 11 (1 rule)
  • V-253283 Data Execution Prevention (DEP) must be configured to at least OptOut. prevents CWE-913

References