RestrictedPython: Sandbox escape via string.Formatter field resolution
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Information disclosure, Security bypass
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-200 and CWE-693.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| zopefoundation | RestrictedPython | before 8.4 | 8.4 | Patch available | CNA |
| — | RestrictedPython (PyPI) | before 8.4 | 8.4 | Patch available | GHSA-hp3v-5vw7-fx9w |
- RestrictedPython Vendorzopefoundation Affected before 8.4 Fixed in 8.4 Patch available CNA
- RestrictedPython (PyPI) Vendor— Affected before 8.4 Fixed in 8.4 Patch available GHSA-hp3v-5vw7-fx9w
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:zope:restrictedpython:*:*:*:*:*:*:*:* | — | — | zopefoundation |
- cpe:2.3:a:zope:restrictedpython:*:*:*:*:*:*:*:* Versions — — ·zopefoundation
Remediation
- Fix · CNA RestrictedPython (zopefoundation) Fixed in 8.4
- Fix · GHSA-hp3v-5vw7-fx9w RestrictedPython (PyPI) Fixed in 8.4 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-76825
- 2026-10-03 Alias added: GHSA-hp3v-5vw7-fx9w
- 2026-11-04 EPSS moved to the 50th–90th percentile
References
Other 4
- https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-hp3v-5vw7-fx9w
- https://github.com/zopefoundation/RestrictedPython/commit/3b47440070b91f8807c2b2998aca99e94783639a
- https://github.com/zopefoundation/RestrictedPython/releases/tag/8.4
- https://github.com/zopefoundation/RestrictedPython
More zopefoundation vulnerabilities
- TI-2011-03162 Unspecified vulnerability in Zope 2.12.x and 2.13.x, as used in Plone 4.0.x through… CVSS 2.0HIGH 9.3
- TI-2026-40297 RestrictedPython guard hooks can be shadowed via positional-only arguments CVSS 3.1HIGH 8.3
- TI-2024-16328 Products.SQLAlchemyDA vulnerable to unauthenticated arbitrary SQL query execution CVSS 3.1CRITICAL 9.8
- TI-2000-00062 The DTML implementation in the Z Object Publishing Environment (Zope) allows remote… CVSS 2.0HIGH 10.0
- TI-2024-31821 RestrictedPython information leakage via `AttributeError.obj` and the `string` module CVSS 4.0HIGH 8.7
- TI-2024-34640 User data deletion by anoynmous users in Zope CVSS 4.0HIGH 8.7
Sources
- CVE-2026-76825 · CVE Program
- CVE-2026-76825 · NVD
- FIRST EPSS
- GHSA-hp3v-5vw7-fx9w · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences