Skip to content

CVE-2025-22153 try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter

HighCVSS 7.9 EPSS 0.40%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: total
Technology
UbuntuDebian

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.

Upgrade path

5 packages: 4 fixed.

PackageAffectedFixed inStatus
debian/restrictedpython(Debian 13) < 8.0-1 8.0-1 Fixed
debian/restrictedpython(Debian 14) < 8.0-1 8.0-1 Fixed
pypi restrictedpython(PyPI) = 6.0; = 6.1; = 6.2; = 7.0 +9 more 8.0 Fixed
ubuntu/restrictedpython(Ubuntu 24.04) < 6.2-1ubuntu0.24.04.1~esm1 6.2-1ubuntu0.24.04.1~esm1 Fixed
zopefoundation RestrictedPython = >= 6.0, < 8.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
pypi restrictedpython(PyPI) >= 6.0, < 8.0 8.0
pypi restrictedpython(PyPI) = 6.0 No fix listed
pypi restrictedpython(PyPI) = 6.1 No fix listed
pypi restrictedpython(PyPI) = 6.2 No fix listed
pypi restrictedpython(PyPI) = 7.0 No fix listed
pypi restrictedpython(PyPI) = 7.0a1.dev0 No fix listed
pypi restrictedpython(PyPI) = 7.0a1.dev1 No fix listed
pypi restrictedpython(PyPI) = 7.0a2.dev0 No fix listed
pypi restrictedpython(PyPI) = 7.1 No fix listed
pypi restrictedpython(PyPI) = 7.2 No fix listed
pypi restrictedpython(PyPI) = 7.2a1.dev0 No fix listed
pypi restrictedpython(PyPI) = 7.3 No fix listed
pypi restrictedpython(PyPI) = 7.4 No fix listed
debian/restrictedpython(Debian:13) < 8.0-1 8.0-1
debian/restrictedpython(Debian:14) < 8.0-1 8.0-1
zopefoundation RestrictedPython = >= 6.0, < 8.0 No fix listed
ubuntu/restrictedpython(Ubuntu:24.04) < 6.2-1ubuntu0.24.04.1~esm1 6.2-1ubuntu0.24.04.1~esm1

References