VIM text file modelines could be used to execute commands
|vim-modeline-command-execution (10835)||High Risk|
VIM (Vi IMproved) could allow a local attacker to execute arbitrary shell commands on the system. If a local attacker creates a malicious text file containing arbitrary shell commands within "modeline" fields, the attacker could cause the commands to be executed with the security privileges of the victim user, once the victim opens the malicious file using VIM.
As a workaround, set modelines=0 in the VIM configuration file (.vimrc).
For Red Hat Linux:
Upgrade to the latest vim package, as listed below. Refer to RHSA-2002:297-17 for more information. See References.
Red Hat 6.2: vim-6.1-18.6x.3 or later
Red Hat 7.0, 7.1, 7.2, and 7.3: vim-6.1-18.7x.2 or later
Red Hat 8.0: vim-6.1-18.8x.1 or later
For Sun Solaris:
Apply the appropriate patch for your system, as listed in Sun Alert ID: 55700. See References.
Upgrade to the latest vim package, as listed below. Refer to OpenPKG Security Advisory OpenPKG-SA-2003.003 for more information. See References.
OpenPKG CURRENT: 6.1.266-20021224 or later
OpenPKG 1.0: 6.1.165-1.1.1 or later
OpenPKG 1.1: 6.1.165-1.1.1 or later
For TurboLinux 7 and 8 (Server and Workstation): Upgrade to the latest version of vim (6.1-10 or later), as listed in TurboLinux Security Announcement TLSA-2003-2. See References.
For Mandrake Linux:
Upgrade to the latest vim package, as listed below. Refer to MandrakeSoft Security Advisory MDKSA-2003:012:vim for more information. See References.
Mandrake Linux 7.2: 6.1-34.2mdk or later
Mandrake Linux 8.0, 8.1, 8.2, 9.0, Multi Network Firewall 8.2, and Single Network Firewall 7.2: 6.1-34.1mdk or later
For Conectiva Linux:
Upgrade to the latest vim package, as listed below. Refer to Conectiva Linux Security Announcement CLSA-2004:812 for more information. See References.
Conectiva Linux 8: 6.1-1U80_1cl or later
For Caldera OpenLinux 3.1.1 (Workstation and Server):
Upgrade to the latest version of vim (6.2-1 or later), as listed in SCO Security Advisory CSSA-2004-015.0. See References.
For other distributions:
Contact your vendor for upgrade or patch information.
- Conectiva Linux Security Announcement CLSA-2004:812: vim.
- Georgi Guninski Security Advisory #59, 2002: Some vim problems, yet still vim much better than windows.
- SCO Security Advisory CSSA-2004-015.0: OpenLinux: vim arbitrary commands execution through modelines. (From LinuxSecurity archive)
- Sun Alert ID: 55700: Sun Linux VIM Package May Give Unprivileged Users the Ability to Execute Arbitrary Commands.
- BID-6384: VIM ModeLines Arbitrary Command Execution Vulnerability
- CVE-2002-1377: vim 6.0 and 6.1, and possibly other versions, allows attackers to execute arbitrary commands using the libcall feature in modelines, which are not sandboxed but may be executed when vim is used to edit a malicious file, as demonstrated using mutt.
- MDKSA-2003:012: Updated vim packages fix arbitrary command execution vulnerability
- OpenPKG-SA-2003.003: Vim
- RHSA-2002-297: Updated vim packages fix modeline vulnerability
- RHSA-2002-302: vim security update
- Conectiva Linux 8.0
- MandrakeSoft Mandrake Linux 7.2
- MandrakeSoft Mandrake Linux 8.0 PPC
- MandrakeSoft Mandrake Linux 8.0
- MandrakeSoft Mandrake Linux 8.1 IA64
- MandrakeSoft Mandrake Linux 8.1
- MandrakeSoft Mandrake Linux 8.2
- MandrakeSoft Mandrake Linux 8.2 PPC
- MandrakeSoft Mandrake Linux 9.0
- MandrakeSoft Mandrake Multi Network Firewall 8.2
- MandrakeSoft Mandrake Single Network Firewall 7.2
- OpenPKG OpenPKG 1.0
- OpenPKG OpenPKG 1.1
- OpenPKG OpenPKG CURRENT
- RedHat Enterprise Linux 2.1 AS
- RedHat Linux 6.2
- RedHat Linux 7
- RedHat Linux 7.1
- RedHat Linux 7.1 for iSeries
- RedHat Linux 7.1 for pSeries
- RedHat Linux 7.2
- RedHat Linux 7.3
- RedHat Linux 8.0
- RedHat Linux Advanced Workstation 2.1 Itanium
- SCO Caldera OpenLinux Server 3.1.1
- SCO Caldera OpenLinux Workstation 3.1.1
- Sun Solaris 5.0
- Turbolinux Turbolinux 7 Server
- Turbolinux Turbolinux 7 Workstation
- Turbolinux Turbolinux 8 Server
- Turbolinux Turbolinux 8 Workstation
- Vim Vim 6.0
- Vim VIM 6.1
Dec 11, 2002
The information within this database may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. In no event shall the author/distributor (IBM Internet Security Systems X-Force) be held liable for any damages whatsoever arising out of or in connection with the use or spread of this information.
For corrections or additions please email ignore thisxforceignore this@ignore thisus.ignore thisibm.comignore this