GHSA-pq59-9fq7-m886: Medium severity pip/AccessControl vulnerability
Impact Python's string format functionality allows someone controlling the format string to "read" objects accessible (recursively) via attribute access and subscription from accessible objects. Those attribute accesses and subscriptions use Python's full blown getattr and getitem, not the policy restricted AccessControl variants getattr and getitem. This can lead to critical information disclosure.
The AccessControl package already guards against direct access to the formatting functions on string instances, but these mitigations did not cover subclasses of str.
Affected are all users who allow untrusted users to create AccessControl controlled Python code and execute it.
Patches A fix was published with version 7.4.
Workarounds There is no workaround.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/AccessControlto a version that resolves this vulnerability.Fixed in 7.4 - Upgrade
Upgrade
AccessControlto a version that resolves this vulnerability.Fixed in 7.4
Event History
Frequently Asked Questions
Who is exposed to this issue?
Users are affected if they allow untrusted users to create and execute AccessControl-controlled Python code. The issue concerns format strings on subclasses of str, where the existing protections for direct access to string formatting functions did not apply.
What does an attacker need to exploit it?
An attacker needs the ability to control a Python format string within AccessControl-controlled code that is executed. They can use attribute access and item subscription during formatting to read recursively accessible objects using unrestricted getattr and getitem behavior.
What is the impact of successful exploitation?
Successful exploitation can disclose critical information from objects reachable through the formatting operation. The disclosed data is read through attribute and subscription traversal rather than AccessControl's policy-restricted access checks.
How can this be remediated or mitigated?
Upgrade AccessControl to version 7.4, which includes the published fix. No workaround is available if patching cannot be performed immediately.