CVE-2024-47532·Python vulnerability
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.3. As a workaround, 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.
- Severity
- medium
- Software
- Python
- Fixed in
- 7.3
- Published
- 2024-09-30
Affected versions
Until: 7.3
Fixed in: 7.3
How to fix this CVE
RestrictedPython versions prior to 7.3 contain an information disclosure vulnerability where attackers can bypass access restrictions through AttributeError manipulation combined with the string module. Upgrade to RestrictedPython 7.3 or later to remediate this issue. If immediate patching is not possible, restrict or remove the string module from the restricted execution environment configuration.
sudo dnf update python3-restrictedpythonDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check the installed RestrictedPython version by running: python3 -c "import RestrictedPython; print(RestrictedPython.__version__)"
- Step 2: Verify if the string module is accessible in your RestrictedPython configuration by checking utility_builtins in your application code: grep -r "utility_builtins" /path/to/app/ | grep -i string
- Step 3: Search application logs for AttributeError exceptions combined with string module access patterns: grep -i "AttributeError" /var/log/application.log | grep -i "string"
- Step 4: After upgrading, re-run the version check to confirm RestrictedPython is at version 7.3 or later: python3 -c "import RestrictedPython; print(RestrictedPython.__version__)"
FAQ
What is CVE-2024-47532?
CVE-2024-47532 is an information disclosure vulnerability in RestrictedPython that allows authenticated users to circumvent access controls and retrieve sensitive data through a combination of AttributeError exploitation and string module manipulation. The flaw undermines the sandboxing intended to safely execute untrusted Python code.
Is CVE-2024-47532 being actively exploited?
No, there is no evidence of active exploitation in the wild or a publicly available proof-of-concept exploit. However, the medium severity rating (CVSS 6.5) warrants prompt patching to prevent potential future attacks.
What versions of RestrictedPython are affected by CVE-2024-47532?
All versions of RestrictedPython prior to version 7.3 are vulnerable. Version 7.3 and later contain the necessary fixes.
How do I check if my server is vulnerable to CVE-2024-47532?
Run: python3 -c "import RestrictedPython; v = RestrictedPython.__version__; print('Vulnerable' if tuple(map(int, v.split('.')[:2])) < (7, 3) else 'Patched')" to determine your vulnerability status.
Does Defensia detect CVE-2024-47532?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If RestrictedPython is installed on a monitored server, CVE-2024-47532 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-47532. Free for 1 server.
Get started free