Skip to main content

RestrictedPython EUVDEUVD-2026-80780

| CVE-2026-76825 HIGH
Information Exposure (CWE-200)
2026-09-16 GitHub_M GHSA-hp3v-5vw7-fx9w
8.4
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate and submit restricted Python
  2. Delivery
    Reference host-exposed string.Formatter
  3. Exploit
    Call get_field/vformat to traverse into __globals__
  4. Execution
    Reach __builtins__ eval/exec
  5. Impact
    Execute arbitrary code on host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V14 - Data Protection Data exposure prevention
MITRE ATT&CK

2 techniques across 2 tactics: Collection, Discovery

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the host application to expose to restricted code one of: the standard-library string module, the string.Formatter class, a Formatter instance, or a Formatter subclass - supplied either through a custom import policy or via the globals passed to restricted execution. This is a non-default condition: stock RestrictedPython does not expose these objects. The attacker must also be able to submit restricted Python code to the sandbox (typically an authenticated user of the hosting application). Limiting factors: only RestrictedPython versions prior to 8.4 are affected, and deployments that never expose string/Formatter are not exploitable regardless of version.

Impact

The CVSS 3.1 base score is 8.4 (vendor vector AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H), reflecting a sandbox escape from RestrictedPython's restricted execution context into the host environment with full confidentiality, integrity, and availability impact. The high score is driven by the scope change (S:C) and full-triad impact - this is a genuine sandbox-escape leading to code execution, not merely information disclosure. However, real-world risk is materially gated by a non-default precondition: exploitation only works if the deploying application exposes the standard-library string module, string.Formatter class, an instance, or a subclass to restricted code (via a custom import policy or globals). Stock RestrictedPython does not expose these, so exploitability depends on host configuration. There is no EPSS score, no CISA KEV listing, and no vendor claim of active exploitation, so this is not confirmed as actively exploited. That said, the fix commit's test suite publicly demonstrates a complete working escape (string.Formatter().get_field('0.__globals__[__builtins__]', ...) → eval), so a public exploit technique effectively exists. Signals are consistent (no KEV/EPSS conflict); the primary caveat is the mislabeled CWE-200/Information Disclosure framing, which understates that this is a full code-execution sandbox escape. Priority is high for anyone running RestrictedPython that exposes string/Formatter to untrusted code; low for deployments that do not.

Exploit ScenarioDerived

An attacker able to submit restricted Python code to an application that exposes string.Formatter (class, instance, or subclass) or the string module to the sandbox crafts a format specification that drives Formatter.get_field/vformat through attribute and item traversal that bypasses safer_getattr. This yields a live reference to a function's __globals__ and __builtins__, from which the attacker reaches eval/exec or file-access primitives and runs arbitrary code in the host environment. A working exploit chain is published in the fix's own regression tests, so the technique is publicly documented.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 16, 2026

Sandbox escape in RestrictedPython versions prior to 8.4 lets code executing inside the restricted context reach host-level primitives - function globals, builtins, file access, and code-execution gadgets - whenever the host exposes the standard-library string module, the string.Formatter class, a Formatter instance, or a Formatter subclass to that restricted code. The prerequisite is non-default: stock RestrictedPython does not surface these objects, so a custom import policy or specially crafted globals must be in place, and the attacker must also be able to submit restricted Python code (typically an authenticated user of the hosting application). A vendor patch is available in 8.4; no public exploit was identified at time of analysis.

RemediationAI

Upgrade to RestrictedPython 8.4, the vendor-released patch that fixes this issue; the relevant change is commit 3b47440070b91f8807c2b2998aca99e94783639a, which blocks import of string.Formatter and raises NotImplementedError from safer_getattr for the format, get_field, get_value, and vformat methods on Formatter instances, the Formatter class, and Formatter subclasses. Full details are in the advisory at https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-hp3v-5vw7-fx9w. If an immediate upgrade is not possible, the effective compensating control is to stop handing the dangerous objects to restricted code: audit the custom import policy and the globals mapping passed to restricted execution and remove any grant of the stdlib string module, string.Formatter, Formatter instances, or Formatter subclasses, replacing them with plain str formatting or a host-provided allow-listed wrapper. The trade-off is that legitimate restricted code relying on string.capwords and similar helpers will break, and any indirect route to a live Formatter object (for example through a shared object graph reachable from an allowed module) must also be closed, so this workaround is weaker than the patch and should be treated as temporary. Note that after upgrading, deployments may still want to remove the string module from exposed globals as defense in depth, since the fix deliberately changes behaviour by making Formatter access raise NotImplementedError rather than silently succeeding.

Affected VersionsENISA

RestrictedPython < 8.4

Affected Packages

pypi restrictedpython fix: 8.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

RestrictedPython defines a subset of Python that a host application can execute on untrusted input, enforcing its restrictions largely through guard functions such as safer_getattr, safe_builtins, and associated attribute/item access wrappers. The vulnerable surface is CPython's string.Formatter, whose format, get_field, get_value, and vformat methods perform attribute and item traversal internally using the interpreter's own mechanisms rather than the guarded accessors RestrictedPython installs. Because those internal lookups never pass through safer_getattr, a live Formatter instance (or the Formatter class itself, called in unbound fashion) acts as an unguarded proxy for arbitrary attribute chains; the upstream regression test demonstrates exactly this by encoding underscore characters with chr(95) and walking '0.__globals__[__builtins__]' to obtain eval and execute '1+1'. The fix in commit 3b47440070b91f8807c2b2998aca99e94783639a hardens safer_getattr in src/RestrictedPython/Guards.py: it refuses the import of string.Formatter outright and raises NotImplementedError for the four unsafe method names when the target is a Formatter instance, the Formatter class, or a subclass of it. CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) is the assigned classification, although the demonstrated consequence - recovering eval from a function's __globals__ - escalates to full sandbox escape with code execution, so the CWE understates the practical reach. The single CPE, cpe:2.3:a:zopefoundation:restrictedpython:*:*:*:*:*:*:*:*, marks all releases before 8.4 as affected.

Know when Restrictedpython gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 8.4 HIGH
AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H
vuln.today AI 8.5 HIGH

AC:H because exploitation depends on a non-default host config exposing Formatter; PR:L as the attacker must be able to submit restricted code; UI:N (no victim action); S:C and full triad for host-environment code execution.

3.1 AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Sep 16, 2026 - 15:18 EUVD
CVE Published
Sep 16, 2026 - 14:09 cve.org
HIGH 8.4

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 4 pypi packages depend on restrictedpython (4 direct, 0 indirect)

Ecosystem-wide dependent count for version 8.4.

Technical POC Analysis

Guard-bypass in RestrictedPython's attribute-access protection, classified by the advisory as CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

The RestrictedPython library, which many applications rely on to safely run untrusted or customer-supplied Python code, is affected by a sandbox escape in versions prior to 8.4 that can let that code reach host-level capabilities such as file access and arbitrary code execution. The exposure is limited to deployments that use a customized import policy or globals and deliberately surface Python's string-formatting objects to restricted code, so most teams are not affected. Leadership should care because any environment matching those conditions effectively loses its isolation boundary, putting the hosting application and any data it can reach at risk.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.6%
Top 54% exploitable
Prevalence
Medium
Established Python sandboxing library used by Zope/Plone and similar app frameworks
Threat Intel
1
1 sources
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
Medium
Technical Impact
Total

Priority Score

43
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy