CVE-2025-22153: try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter
Impact Via a type confusion bug in the CPython interpreter when using try/except RestrictedPython could be bypassed. We believe this should be fixed upstream in Python itself until that we remove support for try/except from RestrictedPython. (It has been fixed for some Python versions.) Patches Patched in version 8.0 by removing support for try/except clauses Workarounds There is no workaround. References none
Published Jan 23, 2025
Affected packages
RestrictedPython
- Ecosystem
- PyPI
- Affected
- >= 6.0, < 8.0
- Fixed in
- 8.0
- Check
pip show RestrictedPython
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
Via a type confusion bug in the CPython interpreter when using try/except* RestrictedPython could be bypassed.
We believe this should be fixed upstream in Python itself until that we remove support for try/except* from RestrictedPython. (It has been fixed for some Python versions.)
Patches
Patched in version 8.0 by removing support for try/except* clauses
Workarounds
There is no workaround.
References
none
Credited to icemac, Nico-Posada, dataflake, tseaver.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-76825
RestrictedPython vulnerable to sandbox escape via string.Formatter field resolution
high8.4Sep 17, 2026CVE-2026-55830
RestrictedPython guard hooks can be shadowed via positional-only arguments
high8.3Aug 28, 2026CVE-2024-47532
RestrictedPython information leakage via `AttributeError.obj` and the `string` module
high7.5Sep 30, 2024
