BIT-python-2022-26488: Python Software Foundation Python (CPython) vulnerability
In Python before 3.10.3 on Windows, local users can gain privileges because the search path is inadequately secured. The installer may allow a local attacker to add user-writable directories to the system search path. To exploit, an administrator must have installed Python for all users and enabled PATH entries. A non-administrative user can trigger a repair that incorrectly adds user-writable paths into PATH, enabling search-path hijacking of other users and system services. This affects Python (CPython) through 3.7.12, 3.8.x through 3.8.12, 3.9.x through 3.9.10, and 3.10.x through 3.10.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Python (CPython)to a version that resolves this vulnerability.Fixed in 3.10.3
Event History
Frequently Asked Questions
Which installations are exposed to this issue?
The issue affects Windows installations where an administrator installed CPython for all users and enabled PATH entries. It affects CPython through 3.7.12, 3.8.x through 3.8.12, 3.9.x through 3.9.10, and 3.10.x through 3.10.2.
What does an attacker need to exploit it?
The attacker needs local access as a non-administrative user. They can trigger a repair that adds user-writable directories to PATH, then use search-path hijacking to affect other users or system services.
How can I determine whether a system may already be affected?
Review Windows PATH entries for user-writable directories, particularly after a non-administrative user has run a Python repair. Also verify whether Python was installed for all users with PATH entries enabled.
What configuration change can reduce exposure if patching is not immediately possible?
Avoid allowing user-writable directories in the system search path and review PATH entries added by Python installation or repair actions. Restricting the conditions that permit a non-administrative user to trigger the affected repair behavior reduces exposure.