Advisory

PYSEC-2026-1874

Also known as: CVE-2025-22153, GHSA-gmj9-h825-chq2

Summary

try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter

Details

Impact
Via a type confusion bug in the CPython interpreter when using try/except* RestrictedPython could be bypassed.

We believe this should be fixed upstream in Python itself until that we remove support for try/except* from RestrictedPython.
(It has been fixed for some Python versions.)

Patches
Patched in version 8.0 by removing support for try/except* clauses

Workarounds
There is no workaround.

References
none

Severity

High Basis: CVSS v3 score 7.9, vector CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L

Dates

Published
2026-07-07 14:34 UTC
Modified
2026-07-07 17:46 UTC

Affected packages and fixes

restrictedpython

PyPI · All systems

Affected

  • introduced 6.0, fixed 8.0 (ecosystem)

Fixed versions

8.0

Fix

  • Fixed version 8.0
    pip install --upgrade restrictedpython==8.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences