Description
RestrictedPython is a restricted execution environment for Python to run untrusted code. A user can gain access to protected (and potentially sensible) information indirectly via AttributeError.obj and the string module. The problem will be fixed in version 7.3. As a workaround, If the application does not require access to the module string, it can remove it from RestrictedPython.Utilities.utility_builtins or otherwise do not make it available in the restricted execution environment.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| zopefoundation | RestrictedPython | < 7.3 | — |
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 | — |
| Debian 12 | restrictedpython | No fix yet | — |
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 | < 7.3 | 7.3 | GHSA-5rfv-66g4-jr8h |
Advisories 1
- USN-7355-1 restrictedpython vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026