highCVSS 8.4Vulnerability

CVE-2026-76825

### Impact 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. ### Patches The problem has been patched by blocking access to `string.Formatter` and unsafe `string.Formatter` traversal methods in `safer_getattr`. Users should upgrade to the patched release once available. Affected and patched version numbers should be filled in when the release is published. ### Workarounds Do not expose the standard library `string` module or `string.Formatter` to restricted code. If a custom import hook is used, deny imports of `string` or provide only a restricted wrapper that does not expose `Formatter`. If custom globals are supplied, ensure neither `string.Formatter` nor `Formatter` instances are available to restricted code.

Properties

ghsa_id
GHSA-hp3v-5vw7-fx9w
summary
RestrictedPython vulnerable to sandbox escape via string.Formatter field resolution
severity
high
cvss_score
8.4
cve_id
CVE-2026-76825
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H
signal_observed_at
2026-09-17T21:32:40+00:00
is_ghsa_only
false
ghsa_published
2026-09-17T16:30:22Z
source_url
https://github.com/advisories/GHSA-hp3v-5vw7-fx9w
ghsa_updated
2026-09-17T16:30:23Z

Related Entities (7)

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]pip/RestrictedPython

AFFECTS (1)

[Software]pip/RestrictedPython

HAS_WEAKNESS (4)

[Weakness]Integer Overflow to Buffer Overflow
[Weakness]Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
[Weakness]Exposure of Sensitive Information to an Unauthorized Actor
[Weakness]Protection Mechanism Failure

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-76825 (CVSS 8.4) — Ninja Signal Threat Intelligence | Ninja Signal