{"id":"CVE-2025-22153","published":"2025-01-23T17:34:27Z","modified":"2025-02-12T20:41:29Z","title":"try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter","vendor":"zopefoundation","product":"RestrictedPython","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.9,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.004,"percentile":0.35093,"provenance":"source"},"cwes":[{"id":"CWE-843","name":"Access of Resource Using Incompatible Type"}],"references":[{"url":"https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-gmj9-h825-chq2","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/zopefoundation/RestrictedPython/commit/48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f","tags":["x_refsource_MISC"]}],"priority":{"score":12.5,"factors":[{"name":"EPSS percentile","points":7.02},{"name":"CVSS severity","points":5.53}]},"vendorSlug":"zopefoundation","affectedVersions":[{"vendor":"zopefoundation","product":"RestrictedPython","versions":[">= 6.0, < 8.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-01-23T18:59:04.049782Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"RestrictedPython","vulnerableRanges":[">=6.0, <8.0"],"patched":["8.0"],"from":["GHSA-gmj9-h825-chq2","PYSEC-2026-1874"],"provenance":"source"}],"summary":{"text":"A type confusion flaw in RestrictedPython (zopefoundation), in versions 6.0 up to 8.0, lets its sandboxing be bypassed when try/except* clauses are used; the root cause is a type confusion bug in the CPython interpreter, versions 3.11 up to 3.13.2. Exploitation requires an attacker who can supply code run through RestrictedPython and who holds high privileges (the attack vector is network-reachable with high attack complexity and no user interaction).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:46:17Z"},"euvd":{"id":"EUVD-2025-0162","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-zopefoundation-restrictedpython-cve-2023-37271","parents":[{"from":"CVE-2023-37271","to":"CVE-2025-22153","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/RestrictedPython/transformer.py"],"commits":["https://github.com/zopefoundation/RestrictedPython/commit/c8eca66ae49081f0016d2e1f094c3d72095ef531","https://github.com/zopefoundation/RestrictedPython/commit/48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f"],"basis":"rarely changed file"}]},{"from":"CVE-2023-41039","to":"CVE-2025-22153","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/RestrictedPython/Guards.py"],"commits":["https://github.com/zopefoundation/RestrictedPython/commit/4134aedcff17c977da7717693ed89ce56d54c120","https://github.com/zopefoundation/RestrictedPython/commit/48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f"],"basis":"rarely changed file"}]}],"children":[{"from":"CVE-2025-22153","to":"CVE-2026-55830","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:RestrictedPython","fromFixed":"8.0","toFixed":"8.3","daysApart":531},{"kind":"same-code","provenance":"machine","files":["src/RestrictedPython/transformer.py"],"commits":["https://github.com/zopefoundation/RestrictedPython/commit/48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f","https://github.com/zopefoundation/RestrictedPython/commit/3737596ec9f28c34a073cc845bd2f4c0a80cb671"],"basis":"rarely changed file"}]},{"from":"CVE-2025-22153","to":"CVE-2026-76825","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/RestrictedPython/Guards.py"],"commits":["https://github.com/zopefoundation/RestrictedPython/commit/48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f","https://github.com/zopefoundation/RestrictedPython/commit/3b47440070b91f8807c2b2998aca99e94783639a"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2023-37271","published":"2023-07-11","fixed":"6.1","kev":false},{"cve":"CVE-2023-41039","published":"2023-08-30","fixed":"6.2","kev":false},{"cve":"CVE-2024-47532","published":"2024-09-30","fixed":"7.3","kev":false},{"cve":"CVE-2025-22153","published":"2025-01-23","fixed":"8.0","kev":false},{"cve":"CVE-2026-55830","published":"2026-07-08","fixed":"8.3","kev":false},{"cve":"CVE-2026-76825","published":"2026-09-16","fixed":"8.4","kev":false}],"package":"PyPI:RestrictedPython"}}