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.

Severity (CVSS 3.1)7.9High
Exploit odds (30 days)0.4%top 65.6% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:13restrictedpython8.0-1DEBIAN-CVE-2025-22153
Debian:14restrictedpython8.0-1DEBIAN-CVE-2025-22153
PyPIrestrictedpython8.0GHSA-gmj9-h825-chq2
PyPIrestrictedpython8.0PYSEC-2026-1874

Affected products (as reported)

VendorProductVersions
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

References