CVE-2025-22153

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

Published Jan 23, 2025 CVSS 3.1 · 7.9 High EPSS < 1% KEV · Not listed
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.

Analysis

No analysis available yet

Remediation

No remediation available yet

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2025-0162 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.
Github GHSA Github GHSA GHSA-gmj9-h825-chq2 try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter
Ubuntu USN Ubuntu USN USN-7355-1 RestrictedPython vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter
Weaknesses CWE-843
References
Metrics cvssV3_1

{'score': 7.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L'}

Subscriptions

No data.

Weaknesses
  • CWE-843

    Access of Resource Using Incompatible Type ('Type Confusion')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Feb 12, 2025, 8:41 PM
Reserved
Dec 30, 2024, 3:00 AM
Status
Deferred
Published
Jan 23, 2025, 6:15 PM
Modified
Jun 17, 2026, 8:45 AM