lists.openwall.net   lists  /  announce  john-users  owl-users  popa3d-users  /  xvendor  oss-security  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4 
Open Source and information security mailing list archives
 
Order Openwall GNU/*/Linux 2.0 on a CD with delivery worldwide
[<prev] [next>] [<thread-prev] [month] [year] [list]
Date: Tue, 5 Dec 2006 23:10:58 +1100 (EST)
From: Damien Miller <djm@...drot.org>
To: Werner Koch <wk@...pg.org>
Subject: Re: GnuPG 1.4 and 2.0 buffer overflow

On Mon, 27 Nov 2006, Werner Koch wrote:

>             GnuPG 1.4 and 2.0 buffer overflow
>            ==================================
[snip]
> 
> The code in question has been introduced on July 1, 1999 and is a
> pretty obvious bug.  make_printable_string is supposed to replace
> possible dangerous characters from a prompt and returns a malloced
> string.  Thus this string may be longer than the orginal one; the
> buffer for the prompt has only be allocated at the size of the original
> string - oops.  Note, that using snprintf would not have helped in
> this case.  How I wish C-90 had introduced asprintf or at least it
> would be available on more platforms.

I think that this is a classic case of a security problem introduced
by attempting to code for the "lowest common denominator" rather than
picking the best API (or the one most conducive to security) and coding
to that.

Why not just pull an asprintf() implementation into gnupg? You can get a
free (MIT licensed) one from OpenSSH's portability code, and I'm sure it
is not the only one.

-d

Hosted by DataForce ISP - Powered by Openwall GNU/*/Linux