Skip to content
OpenAdvisories
High · 8.4 CVE-2026-76825 EUVD-2026-80780GHSA-hp3v-5vw7-fx9wPYSEC-2026-4161

RestrictedPython: Sandbox escape via string.Formatter field resolution

Published Sep 16, 2026 · Updated Sep 16, 2026 · Assigned by GitHub_M

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

VendorProductAffectedFixed
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.

ReleasePackageFixed inAdvisory
Debian 14 restrictedpython 8.4-1 —
Debian 13 restrictedpython No fix yet —
Debian 12 restrictedpython No fix yet —
ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
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

ReleasePackageFixed inAdvisory
Wolfi rolling open-webui 0.11.3-r6 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI restrictedpython < 8.4 8.4 GHSA-hp3v-5vw7-fx9w

References