# CVE-2025-22153: try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter

- Severity: High 7.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.40%, higher than 36% of CVEs (2026-12-01)
- Published: 2025-01-23T17:19:34.000Z
- Modified: 2026-07-07T17:57:15.763Z
- Also known as: GHSA-gmj9-h825-chq2, PYSEC-2026-1874
- Weaknesses: CWE-843
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- zopefoundation RestrictedPython: >= 6.0, < 8.0
- restrictedpython (PyPI): from 6.0 before 8.0

## Every score

- GitHub_M: CVSS:3.1 7.9 High `CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L`
- GitHub: CVSS:3.1 7.9 High `CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L`
- PyPA Advisory Database: CVSS:3.1 7.9 High `CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L`

## References

- <https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-gmj9-h825-chq2> (web)
- <https://github.com/zopefoundation/RestrictedPython/commit/48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-22153> (advisory)
- <https://github.com/zopefoundation/RestrictedPython> (package)
- <https://pypi.org/project/restrictedpython> (package)
- <https://github.com/advisories/GHSA-gmj9-h825-chq2> (advisory)

## Sources

- CVE List: [CVE-2025-22153](https://www.cve.org/CVERecord?id=CVE-2025-22153), CVE Terms of Use, modified 2025-02-12
- GitHub Advisory Database: [GHSA-gmj9-h825-chq2](https://github.com/advisories/GHSA-gmj9-h825-chq2), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2025-22153](https://nvd.nist.gov/vuln/detail/CVE-2025-22153), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1874](https://osv.dev/vulnerability/PYSEC-2026-1874), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-22153 · Whole record: https://cve.day/CVE-2025-22153.json · Rebuilt by cve.day 2026-11-25T22:58:53.547Z
