Skip to content
OpenAdvisories
High USN-7355-1 4 CVEs

restrictedpython vulnerabilities

Published Mar 18, 2025 · Updated Apr 27, 2026

Summary

Nakul Choudhary and Robert Xiao discovered that RestrictedPython did not
properly sanitize certain inputs. An attacker could possibly use this
issue to execute arbitrary code. This issue only affected
Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2023-37271)

Abhishek Govindarasu, Ankush Menat and Ward Theunisse discovered that
RestrictedPython did not correctly handle certain format strings. An
attacker could possibly use this issue to leak sensitive information.
This issue only affected Ubuntu 20.04 LTS and Ubuntu 22.04 LTS.
(CVE-2023-41039)

It was discovered that RestrictedPython did not correctly restrict access
to certain fields. An attacker could possibly use this issue to leak
sensitive information. (CVE-2024-47532)

It was discovered that RestrictedPython contained a type confusion
vulnerability. An attacker could possibly use this issue to execute
arbitrary code. This issue only affected Ubuntu 24.04 LTS and
Ubuntu 24.10. (CVE-2025-22153)

Fixed packages 3

ReleasePackageFixed in
Ubuntu · Pro 20.04 LTS Pro:20.04:LTS restrictedpython 4.0~b3-2ubuntu0.1~esm1
Ubuntu · Pro 22.04 LTS Pro:22.04:LTS restrictedpython 4.0~b3-3ubuntu0.1~esm1
Ubuntu · Pro 24.04 LTS Pro:24.04:LTS restrictedpython 6.2-1ubuntu0.24.04.1~esm1

Vulnerabilities 4

  • High 8.7

    RestrictedPython information leakage via `AttributeError.obj` and the `string` module

    RestrictedPython is a restricted execution environment for Python to run untrusted code. A user can gain access to protected (and potentially sensible) information indirectly via AttributeError.obj and the string module. The problem will be fixed in version 7…

  • High 8.4

    RestrictedPython vulnerable to arbitrary code execution via stack frame sandbox escape

    RestrictedPython is a tool that helps to define a subset of the Python language which allows users to provide a program input into a trusted environment. RestrictedPython does not check access to stack frames and their attributes. Stack frames are accessible …

  • High 8.3

    Sandbox escape via various forms of "format" in RestrictedPython

    RestrictedPython is a restricted execution environment for Python to run untrusted code. Python's "format" functionality allows someone controlling the format string to "read" all objects accessible through recursive attribute lookup and subscription from obj…

  • High 7.9

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

    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…

References

  • report
    https://ubuntu.com/security/CVE-2023-37271
  • report
    https://ubuntu.com/security/CVE-2023-41039
  • report
    https://ubuntu.com/security/CVE-2024-47532
  • report
    https://ubuntu.com/security/CVE-2025-22153