try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- None
- Attack complexity
- High
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-843 and the CVSS impact.
Summary
RestrictedPython is a tool that helps to define a subset of the Python language which allows to provide a program input into a trusted environment. Via a type confusion bug in versions of the CPython interpreter starting in 3.11 and prior to 3.13.2 when using `try/except*`, RestrictedPython starting in version 6.0 and prior to version 8.0 could be bypassed. The issue is patched in version 8.0 of RestrictedPython by removing support for `try/except*` clauses. No known workarounds are available.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| zopefoundation | RestrictedPython | 6.0 to before 8.0 | 8.0 | Patch available | CNA |
| — | RestrictedPython (PyPI) | 6.0 to before 8.0 | 8.0 | Patch available | GHSA-gmj9-h825-chq2 |
- RestrictedPython Vendorzopefoundation Affected 6.0 to before 8.0 Fixed in 8.0 Patch available CNA
- RestrictedPython (PyPI) Vendor— Affected 6.0 to before 8.0 Fixed in 8.0 Patch available GHSA-gmj9-h825-chq2
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:zope:restrictedpython:*:*:*:*:*:*:*:* | — | — | zopefoundation |
- cpe:2.3:a:zope:restrictedpython:*:*:*:*:*:*:*:* Versions — — ·zopefoundation
Remediation
- Fix · CNA RestrictedPython (zopefoundation) Fixed in 8.0
- Fix · GHSA-gmj9-h825-chq2 RestrictedPython (PyPI) Fixed in 8.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2025-22153
- 2026-10-03 Alias added: GHSA-gmj9-h825-chq2
References
More zopefoundation vulnerabilities
- TI-2011-03162 Unspecified vulnerability in Zope 2.12.x and 2.13.x, as used in Plone 4.0.x through… CVSS 2.0HIGH 9.3
- TI-2026-40297 RestrictedPython guard hooks can be shadowed via positional-only arguments CVSS 3.1HIGH 8.3
- TI-2024-16328 Products.SQLAlchemyDA vulnerable to unauthenticated arbitrary SQL query execution CVSS 3.1CRITICAL 9.8
- TI-2000-00062 The DTML implementation in the Z Object Publishing Environment (Zope) allows remote… CVSS 2.0HIGH 10.0
- TI-2024-31821 RestrictedPython information leakage via `AttributeError.obj` and the `string` module CVSS 4.0HIGH 8.7
- TI-2024-34640 User data deletion by anoynmous users in Zope CVSS 4.0HIGH 8.7
Sources
- CVE-2025-22153 · CVE Program
- CVE-2025-22153 · NVD
- FIRST EPSS
- GHSA-gmj9-h825-chq2 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences