CVE-2024-47532: RestrictedPython information leakage via `AttributeError.obj` and the `string` module
Impact A user can gain access to protected (and potentially sensible) information indirectly via AttributeError.obj and the string module. Patches The problem will be fixed in version 7.3. Workarounds If the application does not require access to the module string, it can remove it from RestrictedPython.Utilities.utilitybuiltins or otherwise do not make it available in the restricted execution environment.
Published Sep 30, 2024 · Updated Jan 21, 2025
Affected packages
RestrictedPython
- Ecosystem
- PyPI
- Affected
- < 7.3
- Fixed in
- 7.3
- Check
pip show RestrictedPython
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
A user can gain access to protected (and potentially sensible) information indirectly via AttributeError.obj and the string module.
Patches
The problem will be fixed in version 7.3.
Workarounds
If the application does not require access to the module string, it can remove it from RestrictedPython.Utilities.utility_builtins or otherwise do not make it available in the restricted execution environment.
Credited to Quasar0147, dronex7070, d-maurer, dataflake, icemac.
References
- https://github.com/zopefoundation/RestrictedPython/security/advisories/GHSA-5rfv-66g4-jr8h
- https://github.com/zopefoundation/RestrictedPython/commit/d701cc36cccac36b21fa200f1f2d1945a9a215e6
- https://nvd.nist.gov/vuln/detail/CVE-2024-47532
- https://github.com/pypa/advisory-database/tree/main/vulns/restrictedpython/PYSEC-2024-186.yaml
- https://github.com/advisories/GHSA-5rfv-66g4-jr8h
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-76825
RestrictedPython vulnerable to sandbox escape via string.Formatter field resolution
high8.4Sep 17, 2026CVE-2026-55830
RestrictedPython guard hooks can be shadowed via positional-only arguments
high8.3Aug 28, 2026CVE-2025-22153
try/except* clauses could allow bypass RestrictedPython via type confusion bug in the CPython interpreter
high7.9Jan 23, 2025
