CVE-2025-22153 json
try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter
published 2025-01-23 21 mo ago modified 2026-07-07 4 mo ago also EUVD-2025-0162 , GHSA-gmj9-h825-chq2 , PYSEC-2026-1874
- cvss
- 7.9
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.4%
- EPSS 0.4% chance of exploitation in 30 days, percentile 34%
- public exploits
- 0
- none known
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.
Patch / fix
- pypi restrictedpython 8.0
- zope restrictedpython 8.0
- restrictedpython Debian 14, Debian 13 8.0-1
debian advisories DEBIAN-CVE-2025-22153
- restrictedpython Ubuntu Pro 24.04 LTS 6.2-1ubuntu0.24.04.1~esm1
ubuntu advisories UBUNTU-CVE-2025-22153
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 21 mo ago
Exploit prediction
0.40% chance of exploitation in the next 30 days, higher than 34% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.9 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L |
| GitHub | 3.1 | 7.9 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L |
| OSV | 3.1 | 7.9 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | restrictedpython | >=6.0, <8.0 |
8.0 |
Affected products
- zopefoundation RestrictedPython
Classification
- Weakness
-
- CWE-843 Access of Resource Using Incompatible Type
References
-
github.com
/zopefoundation/RestrictedPython/commit/48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f
web
-
github.com
/zopefoundation/RestrictedPython/security/advisories/GHSA-gmj9-h825-chq2
web
-
nvd.nist.gov
/vuln/detail/CVE-2025-22153
advisory
-
github.com
/zopefoundation/RestrictedPython
package
-
pypi.org
/project/restrictedpython
package
-
github.com
/advisories/GHSA-gmj9-h825-chq2
advisory
Sources
- CVE List CVE-2025-22153
- GitHub Advisory GHSA-gmj9-h825-chq2
- NVD CVE-2025-22153
- OSV PYSEC-2026-1874
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.