Advisory

GHSA-gmj9-h825-chq2

Also known as: CVE-2025-22153, PYSEC-2026-1874

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: The source's own band: HIGH

Dates

Published
2025-01-23 17:19 UTC
Modified
2026-07-07 17:57 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: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences