CVE-2026-76825
HIGH 8.4CVSS 3.1RestrictedPython vulnerable to sandbox escape via string.Formatter field resolution
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.
- Published
- 16 Sep 2026
- Last modified
- 1 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Deferred
- Weakness
- CWE-200CWE-470CWE-680CWE-693
- Also known as
- GHSA-hp3v-5vw7-fx9wPYSEC-2026-4161
- Sources
- NVDJSONOSV GHSA-hp3v-5vw7-fx9wJSONOSV PYSEC-2026-4161JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 8.4 | CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 8.4 | CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | HIGH 8.4 | CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | PyPI | restrictedpython | < 8.4 | 8.4 |
References
- https://github.com/zopefoundation/RestrictedPython/commit/3b47440070b91f8807c2b2998aca99e94783639a · WEB
- https://github.com/zopefoundation/RestrictedPython/releases/tag/8.4 · WEB
- https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-hp3v-5vw7-fx9w · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-76825 · ADVISORY
- https://github.com/zopefoundation/RestrictedPython · PACKAGE
- https://pypi.org/project/restrictedpython · PACKAGE
- https://github.com/advisories/GHSA-hp3v-5vw7-fx9w · ADVISORY
History
- 25 Nov 2026 21:05 UTC · NVD: first stored (published 16 Sep 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 1 Oct 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 17 Sep 2026)