CVE-2009-0316
Description
Untrusted search path in Vim's Python interface allows local users to execute arbitrary code via a Trojan Python file in the current directory.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Untrusted search path in Vim's Python interface allows local users to execute arbitrary code via a Trojan Python file in the current directory.
Vulnerability
The vulnerability is an untrusted search path in Vim's Python interface (src/if_python.c) before version 7.2.045. When Vim runs Python scripts, it relies on PySys_SetArgv, which adds the current working directory to Python's module search path. This allows a local attacker to trick Vim into loading a malicious Python file from the CWD instead of the intended system library. [2], [3]
Exploitation
An attacker must place a Trojan horse Python file (e.g., plugin/bike.vim or any Python module) in the current working directory where a victim launches Vim. When Vim's Python interface initializes, it will inadvertently import the attacker's file due to the altered search path. No special network position is needed; the attacker only needs local file write privileges to the CWD. The user interaction required is simply opening Vim in that directory. [2]
Impact
Successful exploitation allows arbitrary code execution with the privileges of the user running Vim. This can lead to complete compromise of the user's session, including data theft, installation of malware, or further privilege escalation. The impact is local code execution via a Trojan Python file. [3]
Mitigation
The fix is included in Vim version 7.2.045 and later. Users should upgrade to a patched version. For distributions like Red Hat Enterprise Linux 5, the issue was rated low severity and was not planned to be fixed in the vim package. Workarounds include avoiding running Vim from untrusted directories or disabling Python support in Vim if not needed. [2][3]
AI Insight generated on May 24, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
31cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:*+ 21 more
- cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:*range: <=7.2
- cpe:2.3:a:vim:vim:1.0:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:1.22:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:3.0:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:4.0:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.0:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.1:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.2:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.3:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.4:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.5:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.6:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.7:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:5.8:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:6.0:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:6.1:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:6.2:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:6.3:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:6.4:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:7.0:*:*:*:*:*:*:*
- cpe:2.3:a:vim:vim:7.1:*:*:*:*:*:*:*
- (no CPE)range: <7.2.045
- osv-coords9 versionspkg:rpm/opensuse/vim&distro=openSUSE%20Tumbleweedpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-BCLpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/vim&distro=SUSE%20OpenStack%20Cloud%209pkg:rpm/suse/vim&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209
< 8.0.130-1.1+ 8 more
- (no CPE)range: < 8.0.130-1.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
11- bugs.debian.org/cgi-bin/bugreport.cginvd
- bugs.debian.org/cgi-bin/bugreport.cginvd
- lists.apple.com/archives/security-announce/2010//Mar/msg00001.htmlnvd
- support.apple.com/kb/HT4077nvd
- www.mandriva.com/security/advisoriesnvd
- www.nabble.com/Bug-484305%3A-bicyclerepair%3A-bike.vim-imports-untrusted-python-files-from-cwd-td18848099.htmlnvd
- www.openwall.com/lists/oss-security/2009/01/26/2nvd
- www.securityfocus.com/bid/33447nvd
- bugzilla.redhat.com/show_bug.cginvd
- exchange.xforce.ibmcloud.com/vulnerabilities/48275nvd
- svn.pardus.org.tr/pardus/2008/applications/editors/vim/files/official/7.2.045nvd
News mentions
0No linked articles in our index yet.