{"id":"CVE-2025-22153","aliases":["CVE-2025-22153","GHSA-gmj9-h825-chq2","PYSEC-2026-1874"],"related":[],"kind":"vulnerability","state":"published","title":"try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"### Impact\nVia a type confusion bug in the CPython interpreter when using `try/except*` RestrictedPython could be bypassed.\n\nWe believe this should be fixed upstream in Python itself until that we remove support for `try/except*` from RestrictedPython.\n(It has been fixed for some Python versions.)\n\n### Patches\nPatched in version 8.0 by removing support for `try/except*` clauses\n\n### Workarounds\nThere is no workaround.\n\n### References\nnone","format":"markdown","source":"ghsa"},{"lang":"es","text":"RestrictedPython es una herramienta que ayuda a definir un subconjunto del lenguaje Python que permite proporcionar una entrada de programa en un entorno de confianza. A través de un error de confusión de tipos en las versiones del intérprete CPython a partir de la 3.11 y anteriores a la 3.13.2 cuando se usa `try/except*`, se podía omitir RestrictedPython a partir de la versión 6.0 y anteriores a la versión 8.0. El problema se solucionó en la versión 8.0 de RestrictedPython al eliminar la compatibilidad con las cláusulas `try/except*`. No hay workarounds disponibles.","source":"nvd"}],"published":"2025-01-23T17:19:34.000Z","modified":"2026-07-07T17:57:15.763Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L","score":7.9,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L","score":7.9,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L","score":7.9,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L","score":7.9,"rating":"HIGH"}],"cwes":["CWE-843"],"affected":[{"ranges":[{"version":">= 6.0, < 8.0","status":"affected"}],"vendor":"zopefoundation","product":"RestrictedPython","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"6.0","status":"affected","fixed":"8.0"}],"ecosystem":"PyPI","package":"restrictedpython","purl":"pkg:pypi/restrictedpython","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.0","status":"affected","fixed":"8.0"}],"ecosystem":"PyPI","package":"restrictedpython","purl":"pkg:pypi/restrictedpython","source":"pysec"}],"references":[{"url":"https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-gmj9-h825-chq2","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/zopefoundation/RestrictedPython/commit/48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-22153","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/zopefoundation/RestrictedPython","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/restrictedpython","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-gmj9-h825-chq2","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-01-23T18:59:04.049Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-22153","url":"https://www.cve.org/CVERecord?id=CVE-2025-22153","licence":"CVE Terms of Use","modified":"2025-02-12T20:41:29.946Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gmj9-h825-chq2","url":"https://github.com/advisories/GHSA-gmj9-h825-chq2","licence":"CC-BY-4.0","modified":"2026-07-07T17:57:15.763Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-22153","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-22153","licence":"Public domain","modified":"2026-06-17T08:45:23.500Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1874","url":"https://osv.dev/vulnerability/PYSEC-2026-1874","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:36.748Z"}],"updatedAt":"2026-11-25T22:58:53.547Z","epss":{"score":0.004,"percentile":0.36343,"date":"2026-12-01T12:00:22.000Z"}}