Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 176464 - app-editors/{vim|gvim}: feedkeys() and writefile() allowed in sandbox (CVE-2007-2438)
Summary: app-editors/{vim|gvim}: feedkeys() and writefile() allowed in sandbox (CVE-20...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Security
URL: http://marc.info/?t=117762599300001&r...
Whiteboard: B? [noglsa] jaervosz
Keywords:
: 168008 176477 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-29 14:25 UTC by Ali Polatel (RETIRED)
Modified: 2007-06-24 23:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
vim-7.0.235.ebuild (vim-7.0.235.ebuild,815 bytes, text/plain)
2007-04-29 21:39 UTC, Ali Polatel (RETIRED)
no flags Details
vim-core-7.0.235.ebuild (vim-core-7.0.235.ebuild,816 bytes, text/plain)
2007-04-29 22:47 UTC, Ali Polatel (RETIRED)
no flags Details
gvim-7.0.235.ebuild (gvim-7.0.235.ebuild,1.12 KB, text/plain)
2007-04-29 22:48 UTC, Ali Polatel (RETIRED)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Polatel (RETIRED) gentoo-dev 2007-04-29 14:25:00 UTC
feedkeys() and writefile() functions are allowed in sandbox which allows a malicious file run arbitrary commands in a modeline-enabled vim like:
  vim: fdm=expr fde=feedkeys("\\:!touch\ phantom_was_here\\<cr>")
  vim: fdm=expr fde=writefile([""],"phantom_was_here")

 These problems have been fixed with patch-7.0.234[1] and patch-7.0.235[2]
 A temporary solution is to 'set nomodeline' in vimrc which Gentoo already has by default.
Comment 1 Ali Polatel (RETIRED) gentoo-dev 2007-04-29 14:26:24 UTC
 oh and..
 [1] ftp://ftp.vim.org/pub/vim/patches/7.0/7.0.234
 [2] ftp://ftp.vim.org/pub/vim/patches/7.0/7.0.235
 sorry..
Comment 2 Ali Polatel (RETIRED) gentoo-dev 2007-04-29 21:39:22 UTC
Created attachment 117677 [details]
vim-7.0.235.ebuild

 I think bumping vim to version 7.0.235 is a good idea. I've created a snapshot of 
vim patches the way gentoo packages them. It's under http://hawking.nonlogic.org/distfiles/vim-patches-7.0.235.tar.gz
 I'm attaching updated ebuilds, basically only their names and SRC_URI is changed.
Comment 3 Ali Polatel (RETIRED) gentoo-dev 2007-04-29 22:47:45 UTC
Created attachment 117686 [details]
vim-core-7.0.235.ebuild
Comment 4 Ali Polatel (RETIRED) gentoo-dev 2007-04-29 22:48:46 UTC
Created attachment 117688 [details]
gvim-7.0.235.ebuild
Comment 5 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-04-30 12:31:54 UTC
vim please advise and bump as necessary.
Comment 6 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-04-30 12:34:42 UTC
*** Bug 176477 has been marked as a duplicate of this bug. ***
Comment 7 Mike Kelly (RETIRED) gentoo-dev 2007-04-30 14:27:25 UTC
7.0.235 is already in the tree, though currently it is not keyworded stable on any arch. So, I guess the next step is to request keywording, correct?
Comment 8 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-05-02 10:39:54 UTC
Sorry for being late I must have forgot to commit the last one a few days ago.

Arches please test and mark stable. Target keywords are:

vim-7.0.235.ebuild:KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86 ~x86-fbsd"
Comment 9 Raúl Porcel (RETIRED) gentoo-dev 2007-05-02 11:25:07 UTC
ia64 + x86 stable
Comment 10 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-05-02 11:44:53 UTC
armin76 just mentioned that gvim needs to go stable as well.

gvim-7.0.235.ebuild:KEYWORDS="alpha amd64 hppa ia64 mips ppc ~ppc64 sparc x86 ~x86-fbsd"
Comment 11 Ferris McCormick (RETIRED) gentoo-dev 2007-05-02 12:47:49 UTC
sparc all done for vim-core, [g]vim.
Comment 12 Bryan Østergaard (RETIRED) gentoo-dev 2007-05-02 13:52:55 UTC
Alpha done.
Comment 13 Mike Kelly (RETIRED) gentoo-dev 2007-05-02 14:16:25 UTC
app-editors/gvim needs to be marked stable at the same time or there'll be issues for folks who have both vim and gvim installed.
Comment 14 Mike Kelly (RETIRED) gentoo-dev 2007-05-02 14:17:41 UTC
oops, sorry, just was going from old emails when i sent that. ignore me...
Comment 15 Jeroen Roovers (RETIRED) gentoo-dev 2007-05-02 16:15:39 UTC
Stable for HPPA.
Comment 16 Markus Rothe (RETIRED) gentoo-dev 2007-05-02 16:33:01 UTC
ppc64 stable
Comment 17 Tobias Scherbaum (RETIRED) gentoo-dev 2007-05-03 18:46:21 UTC
ppc stable
Comment 18 Daniel Gryniewicz (RETIRED) gentoo-dev 2007-05-04 20:13:39 UTC
amd64 done.
Comment 19 Jeroen Roovers (RETIRED) gentoo-dev 2007-05-05 02:37:23 UTC
*** Bug 168008 has been marked as a duplicate of this bug. ***
Comment 20 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-05-05 06:22:44 UTC
This one is ready for GLSA decision. I tend to vote NO.
Comment 21 Pierre-Yves Rofes (RETIRED) gentoo-dev 2007-05-08 10:38:32 UTC
I vote NO as it seems that Gentoo default install protects against this.
Comment 22 Mike Kelly (RETIRED) gentoo-dev 2007-05-08 11:51:32 UTC
I'd also vote no, but I'd like a way to let users know about a more secure replacement for vim's builtin moreline support that was just added to the tree -- app-vim/securemodelines. I'd recommend that users disable modelines if they have enabled them locally, and install that script instead.

Is that something more appropriate for a GWN article or somethimg?
Comment 23 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-05-08 13:50:53 UTC
I'd say GWN + enote.
Comment 24 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2007-05-08 18:06:36 UTC
I vote no too since it's not the default config, and since modeline is known to be dangerous in some cases. OK for GWN.

Mike, i close this bug but feel free to reopen it if this is useful to you.
Comment 25 Joshua Kinard gentoo-dev 2007-05-13 06:38:17 UTC
All three stable on mips for 7.0.235.