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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| zopefoundation | RestrictedPython | < 8.4 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | restrictedpython | 8.4-1 | — |
| Debian 13 | restrictedpython | No fix yet | — |
| Debian 12 | restrictedpython | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | restrictedpython | No fix yet | — |
| Ubuntu 26.04 LTS | restrictedpython | No fix yet | — |
| Ubuntu 18.04 LTS | restrictedpython | No fix yet | — |
| Ubuntu 16.04 LTS | restrictedpython | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 24.04 LTS | restrictedpython | No fix yet | — |
| Ubuntu Pro 22.04 LTS | restrictedpython | No fix yet | — |
| Ubuntu Pro 20.04 LTS | restrictedpython | No fix yet | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | open-webui | 0.11.3-r6 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | restrictedpython | < 8.4 | 8.4 | GHSA-hp3v-5vw7-fx9w |