Description
RestrictedPython is a tool that helps to define a subset of the Python language which allows to provide a program input into a trusted environment. Via a type confusion bug in versions of the CPython interpreter starting in 3.11 and prior to 3.13.2 when using `try/except*`, RestrictedPython starting in version 6.0 and prior to version 8.0 could be bypassed. The issue is patched in version 8.0 of RestrictedPython by removing support for `try/except*` clauses. No known workarounds are available.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| zopefoundation | RestrictedPython | >= 6.0, < 8.0 | — |
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.0-1 | — |
| Debian 13 | restrictedpython | 8.0-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 24.04 LTS | restrictedpython | 6.2-1ubuntu0.24.04.1~esm1 | USN-7355-1 |
| Ubuntu Pro 22.04 LTS | restrictedpython | 4.0~b3-3ubuntu0.1~esm1 | USN-7355-1 |
| Ubuntu Pro 20.04 LTS | restrictedpython | 4.0~b3-2ubuntu0.1~esm1 | USN-7355-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | restrictedpython | >= 6.0, < 8.0 | 8.0 | GHSA-gmj9-h825-chq2 |
Advisories 1
- USN-7355-1 restrictedpython vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026