pypi package report

Is restrictedpython safe?

6 known vulnerabilities, worst severity HIGH.

// reach

5 direct dependencies

1 carry known advisories, worst MEDIUM

13 packages depend on it

an advisory here reaches each of them

Create a free accountfor every dependency path, dependent and what to upgrade
// ai model usage

No published models are known to use this package.


cvss
8.4
high

CVSS v3.1 base score out of 10

epss
0.62%
medium

chance of exploitation in 30 days, 50th percentile of all CVEs

xyz score
4.2
medium

CyberXYZ composite out of 10

fig. 01 — GHSA-hp3v-5vw7-fx9w, the advisory selected below

// 6 advisories

GHSA-hp3v-5vw7-fx9w

HIGHGitHub ratingCVE-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.

// cvss v3.1 vector

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

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Checked 2026-11-08 at 00:24 UTC. The most recent advisory here was published 2026-09-17. Updated continuously from NVD, GHSA, OSV and CNA feeds.

Think a verdict here is wrong? Tell us — we respond within 2 business days.