# CVE-2026-76825: RestrictedPython: Sandbox escape via string.Formatter field resolution

- Severity: High 8.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.59%, higher than 49% of CVEs (2026-12-01)
- Published: 2026-09-16T14:09:28.795Z
- Modified: 2026-10-01T17:55:55.691Z
- Also known as: GHSA-hp3v-5vw7-fx9w, PYSEC-2026-4161
- Weaknesses: CWE-200, CWE-470, CWE-680, CWE-693
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- 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.

(As written by CVE List.)

## Affected

- zopefoundation RestrictedPython: < 8.4
- restrictedpython (PyPI): before 8.4

## Every score

- GitHub_M: CVSS:3.1 8.4 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.4 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 8.4 High `CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H`

## References

- <https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-hp3v-5vw7-fx9w> (web)
- <https://github.com/zopefoundation/RestrictedPython/commit/3b47440070b91f8807c2b2998aca99e94783639a> (web)
- <https://github.com/zopefoundation/RestrictedPython/releases/tag/8.4> (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)

## Sources

- CVE List: [CVE-2026-76825](https://www.cve.org/CVERecord?id=CVE-2026-76825), CVE Terms of Use, modified 2026-09-16
- GitHub Advisory Database: [GHSA-hp3v-5vw7-fx9w](https://github.com/advisories/GHSA-hp3v-5vw7-fx9w), CC-BY-4.0, modified 2026-10-01
- NVD: [CVE-2026-76825](https://nvd.nist.gov/vuln/detail/CVE-2026-76825), Public domain, modified 2026-09-16
- PyPA Advisory Database: [PYSEC-2026-4161](https://osv.dev/vulnerability/PYSEC-2026-4161), CC-BY-4.0, modified 2026-10-01

---

Page: https://cve.day/CVE-2026-76825 · Whole record: https://cve.day/CVE-2026-76825.json · Rebuilt by cve.day 2026-11-25T22:59:39.056Z
