---
id: CVE-2026-76825
title: >-
  RestrictedPython is a tool that helps define a subset of the Python language
  for accepting program input in a trusted environment
summary: >-
  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…
severity: high
cvss: 8.4
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H'
cwe:
  - CWE-200
  - CWE-470
  - CWE-680
  - CWE-693
vendor: zopefoundation
product: RestrictedPython
affected:
  - RestrictedPython < 8.4
published: '2026-09-16'
updated: '2026-09-16'
sourceUpdated: '2026-09-16T19:17:34.720'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-76825'
references:
  - url: >-
      https://github.com/zopefoundation/RestrictedPython/commit/3b47440070b91f8807c2b2998aca99e94783639a
    label: security-advisories@github.com
  - url: 'https://github.com/zopefoundation/RestrictedPython/releases/tag/8.4'
    label: security-advisories@github.com
  - url: >-
      https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-hp3v-5vw7-fx9w
    label: security-advisories@github.com
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-76825'
  - url: 'https://github.com/advisories/GHSA-hp3v-5vw7-fx9w'
  - url: 'https://github.com/zopefoundation/RestrictedPython'
tags:
  - nvd
  - cve.org
  - ghsa
  - pip
  - osv
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-09-16T18:21:20.870467Z'
ingestedAt: '2026-09-16T14:57:28.064Z'
aliases:
  - GHSA-hp3v-5vw7-fx9w
ecosystem: pip
patched:
  - RestrictedPython 8.4
epss: 0.00624
epssPercentile: 0.47713
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-76825)

Affected packages:

- `RestrictedPython < 8.4`

Patched in:

- `RestrictedPython 8.4`

Source: https://github.com/advisories/GHSA-hp3v-5vw7-fx9w
