<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>238120</bug_id>
          <alias>CVE-2008-4101</alias>
          <creation_ts>2008-09-19 15:19 0000</creation_ts>
          <short_desc>app-editors/vim &lt;7.2.010 control-k command execution (CVE-2008-4101)</short_desc>
          <delta_ts>2009-02-22 15:13:27 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>ASSIGNED</bug_status>
          
          <bug_file_loc>http://www.rdancer.org/vulnerablevim-K.html</bug_file_loc>
          <status_whiteboard>B2 [ebuild]</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>rbu@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>elias@pipping.org</cc>
    
    <cc>vim@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-09-19 15:19:12 0000</bug_when>
            <thetext>CVE-2008-4101 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2008-4101):
  Vim 3.0 through 7.x before 7.2.010 does not properly escape
  characters, which allows user-assisted attackers to (1) execute
  arbitrary shell commands by entering a K keystroke on a line that
  contains a &quot;;&quot; (semicolon) followed by a command, or execute
  arbitrary Ex commands by entering an argument after a (2) &quot;Ctrl-]&quot;
  (control close-square-bracket) or (3) &quot;g]&quot; (g close-square-bracket)
  keystroke sequence, a different issue than CVE-2008-2712.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-09-19 15:55:35 0000</bug_when>
            <thetext>I am not able to reproduce this issue, vim herd?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>elias@pipping.org</who>
            <bug_when>2008-09-19 18:12:43 0000</bug_when>
            <thetext>Steps to reproduce:

Open a new file in vim.
Type in http://www.google.co.uk/search?q=&amp;xclock&amp;.
Press V (capital), thereby selecting the whole line in visual mode.
Press K (capital), thereby looking up the selection.

As a result, xclock is launched.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hawking@gentoo.org</who>
            <bug_when>2008-09-19 18:55:22 0000</bug_when>
            <thetext>{gvim,vim,vim-core}-7.2.021 are in CVS.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>keytoaster@gentoo.org</who>
            <bug_when>2008-09-21 11:41:26 0000</bug_when>
            <thetext>Given that I&apos;m running 7.2.021 and am still able to reproduce it as described in comment #2, I assume not all issues are fixed?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>elias@pipping.org</who>
            <bug_when>2008-10-10 17:58:07 0000</bug_when>
            <thetext>(In reply to comment #4)
&gt; Given that I&apos;m running 7.2.021 and am still able to reproduce it as described
&gt; in comment #2, I assume not all issues are fixed?
&gt; 
That doesn&apos;t surprise me much. There might be something I&apos;m missing about the way vim is built
in gentoo, but it looks like the fix (patch 7.2.010) is never applied. Not only because I can&apos;t seem
to find it anywhere among the patches that actually are applied, but also because I can happily cd
to $S and apply the patch myself.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>elias@pipping.org</who>
            <bug_when>2008-12-24 22:52:24 0000</bug_when>
            <thetext>ping?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lack@gentoo.org</who>
            <bug_when>2009-02-19 19:31:49 0000</bug_when>
            <thetext>I did some research - NONE of the patches were being applied in vim-7.2.021 - It was exactly equivalent to vim-7.2

I&apos;ve just checked in vim-core-7.2.108, vim-7.2.108, and gvim-7.2.108, which apply all applicable patches, and I have verified that this bug in particular is fixed.

Let&apos;s give them some time to settle out, then we can stabilize.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>elias@pipping.org</who>
            <bug_when>2009-02-21 16:53:35 0000</bug_when>
            <thetext>What&apos;s a bit strange is:

I&apos;d except S-K to just
 (1) show a manpage if there is one for whatever i selected
 (2) show an error message or simply do nothing if (1) is not the case.

Now, with 7.2.108 (and thus, the .21 patch), xclock is no longer opened when I select &quot;http://www.google.co.uk/search?q=&amp;xclock&amp;&quot; (see also comment #2), which is good. However I still do get this:

  http://www.google.co.uk/search?q=&amp;xclock&amp;: No such file or directory
  No manual entry for http://www.google.co.uk/search?q=&amp;xclock&amp;

The latter is what man(1) tells me. The former is what makes me scratch my head. Let me modify this a bit:

Type in &quot;/usr/bin/xclock&quot;, select everything using S-V and press S-K to open the manpage. What happens (at least for me), is that /usr/bin/xclock (the binary) is opened. This is harmless (I suppose) because the binary is not run but only viewed (like :r). Still there&apos;s no reason for that to happen, is there? (Of course I could&apos;ve gone with anything, no reason to choose a binary here. /etc/passwd works just as well).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lack@gentoo.org</who>
            <bug_when>2009-02-22 15:13:27 0000</bug_when>
            <thetext>(In reply to comment #8)
&gt; Type in &quot;/usr/bin/xclock&quot;, select everything using S-V and press S-K to open
&gt; the manpage. What happens (at least for me), is that /usr/bin/xclock (the
&gt; binary) is opened. This is harmless (I suppose) because the binary is not run
&gt; but only viewed (like :r). Still there&apos;s no reason for that to happen, is
&gt; there? (Of course I could&apos;ve gone with anything, no reason to choose a binary
&gt; here. /etc/passwd works just as well).

Well, according to &apos;:help K&apos;, this all depends on the value you have for &apos;:set keywordprg&apos;  Mine apparently defaults to &apos;man -s&apos;, which, after some &apos;special&apos; processing regarding the &apos;-s&apos; flag, means that whatever word is under the cursor is passed to &apos;man&apos; If it&apos;s &apos;strcpy&apos;, you get:

man strcpy

Which obviously works as expected.

If it&apos;s &apos;/etc/passwd&apos;, it just passes this right to man, like this:

man /etc/passwd

And this ends up running /etc/passwd through whatever troff formatter man uses these days and showing it in your pager.

This isn&apos;t a bug, it&apos;s just the way man works... Try it from your shell.

From &apos;man(1)&apos;:

... However, if name contains  a  slash  (/)  then  man interprets  it  as a file specification, so that you can do man ./foo.5 or even man /cd/foo/bar.1.gz.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>