Vulnerability · Published Jan 23, 2025 · Assigned by GitHub_M
CVE-2025-22153try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter
High 7.9
In plain English
A high-severity type confusion in RestrictedPython from zopefoundation. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 34% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:13 | restrictedpython | 8.0-1 | DEBIAN-CVE-2025-22153 |
| Debian:14 | restrictedpython | 8.0-1 | DEBIAN-CVE-2025-22153 |
| PyPI | restrictedpython | 8.0 | GHSA-gmj9-h825-chq2 |
| PyPI | restrictedpython | 8.0 | PYSEC-2026-1874 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| zopefoundation | RestrictedPython | >= 6.0, < 8.0 |
Weakness: CWE-843 · Vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L