Bug 248542 - (CVE-2007-2953) CVE-2007-2953 vim format string flaw
CVE-2007-2953 vim format string flaw
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
: Security
Depends On: 453541 453542 453543 453544 453545
  Show dependency treegraph
Reported: 2007-07-17 08:19 EDT by Mark J. Cox
Modified: 2009-06-11 08:53 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-09 03:38:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mark J. Cox 2007-07-17 08:19:11 EDT
Secunia Research has discovered a vulnerability in Vim, which can be
exploited by malicious people to compromise a vulnerable system.

Vulnerability details:

A format string error in the "helptags_one()" function in src/ex_cmds.c
when running the "helptags" command can be exploited to execute
arbitrary code via specially crafted help files. The "helptags" command
creates a tag file from tags surrounded by asterisks in help files, and
the part of the code that handles tags starting with the string "help-
tags" is incorrect, leading to this vulnerability.

The offending code in src/ex_cmds.c looks like this, starting from line

            s = ((char_u **)ga.ga_data)[i];
            if (STRNCMP(s, "help-tags", 9) == 0)
                /* help-tags entry was added in formatted form */
                fprintf(fd_tags, (char *)s);

Successful exploitation requires that the user is tricked into running
"helptags" on malicious data.

The vulnerability is confirmed in versions 6.4 and 7.1, as well as the
version included in Fedora Core 6. Other versions may also be affected.

Proof of Concept:

Here is a simple PoC:

$ mkdir secunia
$ echo '*help-tags%.1111111111u%x%x%x%x%x%x%x%x%n*' > secunia/help.txt
$ vim -c 'helptags secunia/'
$ vim
:helptags secunia/

Closing comments:

We have assigned this vulnerability Secunia advisory SA25941 and the CVE
identifier CVE-2007-2953.

Credits should go to:
Ulf Harnhammar, Secunia Research.
Comment 1 Tomas Hoger 2007-08-15 06:02:58 EDT
Issue is public now, lifting embargo.
Comment 8 Red Hat Product Security 2009-01-09 03:38:07 EST
This issue was addressed in:

Red Hat Enterprise Linux:

Note You need to log in before you can comment on or make changes to this bug.