CVE-2025-22153: Python Sandbox Allows Exceptiongroup

Allowing `ExceptionGroup` or `try/except*` (`TryStar` AST nodes) in an environment executing untrusted Python code exposes the application to a sandbox escape via a type confusion vulnerability in CPython < 3.13.2 (CVE-2025-22153). Disallow `ExceptionGroup` and `TryStar` nodes in restricted execution environments.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2025-22153-python-sandbox-allows-exceptiongroup --engine opengrep

Description

Allowing `ExceptionGroup` or `try/except*` (`TryStar` AST nodes) in an environment executing untrusted Python code exposes the application to a sandbox escape via a type confusion vulnerability in CPython < 3.13.2 (CVE-2025-22153). Disallow `ExceptionGroup` and `TryStar` nodes in restricted execution environments.