CVE-2026-76825
CVE-2026-76825 · RestrictedPython: Sandbox escape via string.Formatter field resolution
This page contains facts from public vulnerability sources. Check the original advisory before updating.
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.
CVSS 8.4 · High · EPSS 0.6% · Fix available
- Published
- Updated
Affected products and versions
restrictedpython
- Versions
- < 8.4: Affected
No fix published
restrictedpython Debian:12
- Versions
- 4.0~b3-3
- 6.2-1
- 8.0-1
- 8.1-1
- 8.4-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
restrictedpython Debian:13
- Versions
- 8.0-1
- 8.1-1
- 8.4-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
restrictedpython Debian:14
- Versions
- 8.0-1
- 8.1-1
- Affected ranges
- ECOSYSTEM: < 8.4-1
Update to 8.4-1
restrictedpython PyPI
- Versions
- 3.4.2
- 3.4.3
- 3.5.0
- 3.5.1
- 3.5.2
- 3.6.0
- 3.6.0a1
- 4.0
- 4.0a1
- 4.0a2
- 4.0a3
- 4.0b1
- 4.0b2
- 4.0b3
- 4.0b4
- 4.0b5
- 4.0b6
- 4.0b7
- 4.0b8
- 5.0
- 5.1
- 5.2
- 5.2a1.dev0
- 5.3
- 5.3a1.dev0
- 5.4
- 6.0
- 6.0a1.dev0
- 6.1
- 6.2
- 7.0
- 7.0a1.dev0
- 7.0a1.dev1
- 7.0a2.dev0
- 7.1
- 7.2
- 7.2a1.dev0
- 7.3
- 7.4
- 8.0
- 8.1
- 8.1a1.dev0
- 8.2
- 8.3
- 8.3a1.dev0
- Affected ranges
- ECOSYSTEM: < 8.4
Update to 8.4
restrictedpython Ubuntu:16.04:LTS
- Versions
- 3.6.0-0ubuntu4
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
restrictedpython Ubuntu:18.04:LTS
- Versions
- 3.6.0-0ubuntu4
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
restrictedpython Ubuntu:Pro:20.04:LTS
- Versions
- 4.0~b3-2
- 4.0~b3-2ubuntu0.1~esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
restrictedpython Ubuntu:Pro:22.04:LTS
- Versions
- 4.0~b3-2
- 4.0~b3-2ubuntu1
- 4.0~b3-3
- 4.0~b3-3ubuntu0.1~esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
restrictedpython Ubuntu:Pro:24.04:LTS
- Versions
- 4.0~b3-3
- 6.2-1
- 6.2-1ubuntu0.24.04.1~esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
restrictedpython Ubuntu:26.10
- Versions
- 8.1-1
- 8.4-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
restrictedpython Ubuntu:26.04:LTS
- Versions
- 8.0-1
- 8.1-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
Original sources
- 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://nvd.nist.gov/vuln/detail/CVE-2026-76825