Bug 455455 (CVE-2008-3432)

Summary: CVE-2008-3432 vim: heap buffer overflow in mch_expand_wildcards()
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: karsten
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-09 08:36:36 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: 453541, 453542, 453543    
Bug Blocks:    

Description Tomas Hoger 2008-07-15 15:58:35 UTC
Jan Minar's test suite [1] for multiple vim vulnerabilities uncovered an old vim
bug that could trigger a heap buffer overflow in mch_expand_wildcards() in
os_unix.c when file or directory with specially crafted name is opened in vim.

  [1] http://www.rdancer.org/vulnerablevim-netrw.tar.bz2

Issue is caused by incorrect computation of memory requirements for buffer to
store external command executed by vim.  File / directory name is escaped /
quoted before being passed to an external command, however, possible quoting is
not taken into account when allocating memory.

Issue was introduced in 6.2.429:
  http://vim.cvs.sourceforge.net/vim/vim/src/os_unix.c?view=log#rev1.104
  ftp://ftp.vim.org/pub/vim/patches/6.2.429

and fixed upstream in 6.3.059:
  http://vim.cvs.sourceforge.net/vim/vim/src/os_unix.c?view=log#rev1.111
  ftp://ftp.vim.org/pub/vim/patches/6.3/6.3.059

and later re-written for vim 7.0 to use backslash escaping instead of quoting:
  http://vim.cvs.sourceforge.net/vim/vim7/src/os_unix.c?r1=1.49&r2=1.50

For further details, see:
  http://www.openwall.com/lists/oss-security/2008/07/15/4

Comment 1 Tomas Hoger 2008-07-15 15:59:54 UTC
This issue only affects vim packages as shipped in Red Hat Enterprise Linux 3
and 4, which are based on vim 6.3.046.

Comment 3 Red Hat Product Security 2009-01-09 08:36:36 UTC
This issue was addressed in:

Red Hat Enterprise Linux:
  http://rhn.redhat.com/errata/RHSA-2008-0617.html