CVE-2026-76825 Details
Description
RestrictedPython is a tool that helps define a subset of the Python language for accepting program input in a trusted environment. Prior to 8.4, RestrictedPython could allow a sandbox escape when a custom import policy or globals exposed the standard library string module, the string.Formatter class, a Formatter instance, or a Formatter subclass to restricted code. The string.Formatter methods format, get_field, get_value, and vformat performed attribute and item traversal internally without passing through RestrictedPython's safer_getattr protections. Restricted code could use those live object references to reach function globals, builtins, file access, or code execution primitives, affecting confidentiality, integrity, and availability in the host environment. This issue is fixed in version 8.4.
A sandbox escape vulnerability has been identified in RestrictedPython versions prior to 8.4. This issue arises when the standard library string module or string.Formatter class is exposed to restricted code, either through a custom import policy or globals. The vulnerability allows access to sensitive objects and functions by bypassing RestrictedPython's safety measures. This could lead to unauthorized file access, code execution, or exposure of function globals, thereby compromising the host environment's security.
Users should upgrade to RestrictedPython version 8.4 or later, and avoid exposing the string module or string.Formatter to restricted code. If a custom import policy is used, deny imports of string or provide a restricted wrapper that does not expose Formatter. When supplying custom globals, ensure that string.Formatter and its instances are not available to the restricted code.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Sep 16, 2026CISA-ADP
Assessed Sep 16, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/zopefoundation/RestrictedPython/commit/3b47440070b91f8807c2b2998aca99e94783639a | [email protected] | Source CodeVendor |
| https://github.com/zopefoundation/RestrictedPython/releases/tag/8.4 | [email protected] | Release NotesVendor |
| https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-hp3v-5vw7-fx9w | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-200 | Exposure of Sensitive Information to an Unauthorized Actor | [email protected] |
| CWE-470 | Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') | [email protected] |
| CWE-680 | Integer Overflow to Buffer Overflow | [email protected] |
| CWE-693 | Protection Mechanism Failure | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| RestrictedPython | < 8.4 |
CPE
Remediation
| |
Change History
2 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Sep 16, 2026 | CVE Modified | CISA-ADP |
| Sep 16, 2026 | New CVE Received | [email protected] |
Volerion