J-Security Center

Title: Vim Swap File Race Condition Vulnerability

Severity: MODERATE

Description:

Vim is an enhanced version of the popular text editor vi.

When a file is edited, the 'vim' program maintains a swap file to record the changes made to the file. Swap files are generally kept in the same directory as the file being edited. The filename of the swap file is normally the same as the file being edited, with the extension '.swp'. On Unix systems, a '.' is also prepended onto the beginning of the swap file name.

A race condition vulnerability exists in the swap file mechanism used by the 'vim' program. The error occurs when a swap file name for a file being opened is symbolically linked to a non-existent file. The program fails to check if the file is a empty symbolic link, and writes its swap data to the non-existent file.

By conjecturing the name of a file to be edited by another user, it may be possible for a local user to create a malicious symbolic link to a non-existent file. This could cause the new target file to be created with the permissions of the user running vim.

Affected Products:

  • Caldera OpenLinux 2.3.0
  • RedHat Linux 5.2.0
  • RedHat Linux 5.2.0 alpha
  • RedHat Linux 5.2.0 i386
  • RedHat Linux 5.2.0 sparc
  • RedHat Linux 6.2.0
  • RedHat Linux 6.2.0 alpha
  • RedHat Linux 6.2.0 i386
  • RedHat Linux 6.2.0 sparc
  • RedHat Linux 7.0.0
  • RedHat Linux 7.0.0 alpha
  • RedHat Linux 7.0.0 i386
  • RedHat Linux 7.0.0 sparc
  • S.u.S.E. Linux 6.1.0
  • S.u.S.E. Linux 6.2.0
  • S.u.S.E. Linux 6.3.0
  • S.u.S.E. Linux 6.4.0
  • S.u.S.E. Linux 7.0.0
  • S.u.S.E. Linux 7.1.0
  • SCO eDesktop 2.4.0
  • SCO eServer 2.3.1
  • VIM Development Group VIM 5.0.0
  • VIM Development Group VIM 5.1.0
  • VIM Development Group VIM 5.2.0
  • VIM Development Group VIM 5.3.0
  • VIM Development Group VIM 5.4.0
  • VIM Development Group VIM 5.5.0
  • VIM Development Group VIM 5.6.0
  • VIM Development Group VIM 5.7.0

Juniper Networks provides this content via a wide variety of sources and production methods. If notified of errors or omissions in the content of this page, Juniper Networks, at its discretion, will modify or remove the page or leave the content as is, depending on various factors including but not limited to the reputation and authority of the party providing the notification. Please use the contact information displayed elsewhere on this page to report any errors or omissions regarding the content on this page.