Sandbox Escape in RestrictedPython Affects Code Execution Capabilities
CVE-2026-76825
What is CVE-2026-76825?
RestrictedPython is a specialized tool designed to define a limited subset of the Python programming language for secure program execution in trusted environments. However, prior to version 8.4, it was found that RestrictedPython could potentially allow for a sandbox escape, specifically when a custom import policy or globals inadvertently exposed the standard library string module or its components to restricted execution contexts. This vulnerability stems from the internal handling of attribute and item traversal within certain string.Formatter methods, which did not utilize RestrictedPython's intended safer_getattr protections effectively. Consequently, malicious code could exploit existing object references, enabling unauthorized access to function globals, builtins, and other sensitive operations, thereby compromising the confidentiality, integrity, and availability of the host system. This critical issue has been resolved in version 8.4 of RestrictedPython.
Affected Version(s)
RestrictedPython < 8.4
