BugTraq
GnuPG 1.4 and 2.0 buffer overflow Nov 27 2006 05:13PM
Werner Koch (wk gnupg org) (2 replies)
Re: GnuPG 1.4 and 2.0 buffer overflow Dec 05 2006 12:10PM
Damien Miller (djm mindrot org)
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

[ reply ]
safely concatenating strings in portable C (Re: GnuPG 1.4 and 2.0 buffer overflow) Nov 30 2006 01:41AM
Solar Designer (solar openwall com) (1 replies)
Re: safely concatenating strings in portable C (Re: GnuPG 1.4 and 2.0 buffer overflow) Dec 01 2006 09:45AM
Simon Josefsson (simon josefsson org)


 

Privacy Statement
Copyright 2010, SecurityFocus