Untrusted search path vulnerability in the PySys_SetArgv API function in Python 2.6 and earlier, and possibly later versions, prepends an empty string to sys.path when the argv[0] argument does not contain a path separator, which might allow local users to execute arbitrary code via a Trojan horse Python file in the current working directory.
The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product’s direct control.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Python | Python | * | 2.6.6 (excluding) |
Python | Python | 3.1.0 (including) | 3.1.3 (excluding) |
Red Hat Enterprise Linux 5 | RedHat | python-0:2.4.3-43.el5 | * |
Python2.4 | Ubuntu | dapper | * |
Python2.4 | Ubuntu | gutsy | * |
Python2.4 | Ubuntu | hardy | * |
Python2.4 | Ubuntu | intrepid | * |
Python2.4 | Ubuntu | jaunty | * |
Python2.4 | Ubuntu | karmic | * |
Python2.5 | Ubuntu | gutsy | * |
Python2.5 | Ubuntu | hardy | * |
Python2.5 | Ubuntu | intrepid | * |
Python2.5 | Ubuntu | jaunty | * |
Python2.5 | Ubuntu | karmic | * |
Python2.6 | Ubuntu | karmic | * |
Python2.6 | Ubuntu | lucid | * |
Python2.6 | Ubuntu | upstream | * |
Python2.7 | Ubuntu | upstream | * |
Python3.1 | Ubuntu | lucid | * |
Python3.1 | Ubuntu | upstream | * |
Python3.2 | Ubuntu | upstream | * |
This might allow attackers to execute their own programs, access unauthorized data files, or modify configuration in unexpected ways. If the product uses a search path to locate critical resources such as programs, then an attacker could modify that search path to point to a malicious program, which the targeted product would then execute. The problem extends to any type of critical resource that the product trusts. Some of the most common variants of untrusted search path are: