Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. RestrictedPython
  4. ›
  5. CVE-2026-76825

CVE-2026-76825: RestrictedPython vulnerable to sandbox escape via string.Formatter field resolution

September 17, 2026

RestrictedPython could allow a sandbox escape when a policy exposes the standard library string module, or otherwise exposes string.Formatter, to restricted code.

string.Formatter field resolution methods such as get_field can perform attribute and item traversal internally and return live object references. This can bypass RestrictedPython’s normal attribute guards and may allow access to sensitive objects such as function globals, builtins, file access, or code execution primitives.

Users are impacted if they run untrusted code with RestrictedPython and expose string.Formatter, directly or indirectly, for example through a custom import policy or globals.

References

  • github.com/advisories/GHSA-hp3v-5vw7-fx9w
  • github.com/zopefoundation/RestrictedPython/commit/3b47440070b91f8807c2b2998aca99e94783639a
  • github.com/zopefoundation/RestrictedPython/releases/tag/8.4
  • github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-hp3v-5vw7-fx9w
  • nvd.nist.gov/vuln/detail/CVE-2026-76825

Code Behaviors & Features

Detect and mitigate CVE-2026-76825 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 8.4.0

Fixed versions

  • 8.4.0

Solution

Upgrade to version 8.4.0 or above.

Impact 8.4 HIGH

CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  • CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
  • CWE-680: Integer Overflow to Buffer Overflow
  • CWE-693: Protection Mechanism Failure

Source file

pypi/RestrictedPython/CVE-2026-76825.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Fri, 18 Sep 2026 12:17:07 +0000.