Skip to content
OpenAdvisories
High · 7.9 CVE-2025-22153 EUVD-2025-0162GHSA-gmj9-h825-chq2PYSEC-2026-1874

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

Published Jan 23, 2025 · Updated Feb 12, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
zopefoundation RestrictedPython >= 6.0, < 8.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 restrictedpython 8.0-1 —
Debian 13 restrictedpython 8.0-1 —
ReleasePackageFixed inAdvisory
Ubuntu Pro 24.04 LTS restrictedpython 6.2-1ubuntu0.24.04.1~esm1 USN-7355-1
Ubuntu Pro 22.04 LTS restrictedpython 4.0~b3-3ubuntu0.1~esm1 USN-7355-1
Ubuntu Pro 20.04 LTS restrictedpython 4.0~b3-2ubuntu0.1~esm1 USN-7355-1

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI restrictedpython >= 6.0, < 8.0 8.0 GHSA-gmj9-h825-chq2

Advisories 1

References