Bug 481565 (CVE-2009-0316)

Summary: CVE-2009-0316 vim: untrusted python modules search path
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: bressers, chtan, karsten, psplicha
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://www.nabble.com/Bug-484305%3A-bicyclerepair%3A-bike.vim-imports-untrusted-python-files-from-cwd-td18848099.html
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-02 19:17:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 482814    
Bug Blocks:    

Description Jan Lieskovsky 2009-01-26 12:45:30 UTC
Untrusted search path vulnerability in the of Vim allows local
users to execute arbitrary code via a Trojan horse Python file in the
current working directory, related to an erroneous setting of sys.path
by the PySys_SetArgv function.

References (test case, PoC):
http://www.nabble.com/Bug-484305%3A-bicyclerepair%3A-bike.vim-imports-untrusted-python-files-from-cwd-td18848099.html

Proposed patch:
The Debian patch for similar dia's Python related issue,
available at:

http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=pythonpath.diff;att=1;bug=504251

should be sufficient to resolve this issue.

Comment 1 Jan Lieskovsky 2009-01-26 12:47:15 UTC
This issue does NOT affect the version of the Vim package, as shipped
with Red Hat Enterprise Linux 2.1.

This issue affects the versions of the Vim package, as shipped 
with Red Hat Enterprise Linux 3, 4, and 5. 

Comment relevant to fixes for RHEL-{3,4,5}:

The Red Hat Security Response Team has rated this issue as having low security
impact, a future update may address this flaw.  More information regarding
issue severity can be found here:
http://www.redhat.com/security/updates/classification/

Comment 2 Jan Lieskovsky 2009-01-26 12:48:52 UTC
This issue affects the versions of the Vim package, as shipped 
with Fedora releases of 9, 10 and devel.

Please fix.

Comment 3 Karsten Hopp 2009-01-26 16:24:51 UTC
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=493937

This has been fixed upstream with patch 7.2.045
Fedora releases 9, 10 and devel are at least at patchlevel 60 and are not vulnerable.

Comment 4 Jan Lieskovsky 2009-01-28 10:58:38 UTC
Common Vulnerabilities and Exposures assigned an identifier CVE-2009-0316 to
this vulnerability:

Untrusted search path vulnerability in the Python module in vim allows
local users to execute arbitrary code via a Trojan horse Python file
in the current working directory, related to a vulnerability in the
PySys_SetArgv function (CVE-2008-5983).

References:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0316
http://www.nabble.com/Bug-484305%3A-bicyclerepair%3A-bike.vim-imports-untrusted-python-files-from-cwd-td18848099.html
http://www.openwall.com/lists/oss-security/2009/01/26/2

Comment 5 Petr Šplíchal 2009-04-27 13:50:19 UTC
I guess this issue does not affect RHEL-{3,4} as the vim package
is compiled without python support on these.

# vim --version
VIM - Vi IMproved 6.3 (2004 June 7, compiled Nov 17 2008 08:14:13)
...
+path_extra +perl +postscript +printer -python +quickfix +rightleft -ruby

Comment 6 Tomas Hoger 2009-07-13 12:11:28 UTC
(In reply to comment #3)
> This has been fixed upstream with patch 7.2.045

Upstream fix:
http://vim.svn.sourceforge.net/viewvc/vim/vim7/src/if_python.c?r1=1124&r2=1257
ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.045

Comment 7 Josh Bressers 2010-05-19 20:46:26 UTC
Statement:

This issue did not affect vim as shipped in Red Hat Enterprise Linux 3 and 4. This issue is not planned to be fixed in vim packages in Red Hat Enterprise Linux 5.