BugTraq
Re: Calife heap corrupt / potential local root exploit Feb 27 2004 04:49PM
Ollivier Robert (roberto keltia freenix fr) (1 replies)
Re: Calife heap corrupt / potential local root exploit Feb 27 2004 08:08PM
Carson Gaspar carson+bugtraq (at) taltos (dot) org [email concealed] (carson+bugtraq taltos org) (1 replies)


--On Friday, February 27, 2004 16:49:34 +0000 Ollivier Robert
<roberto (at) keltia.freenix (dot) fr [email concealed]> wrote:

> In-Reply-To: <20040227091921.26210.qmail (at) www.securityfocus (dot) com [email concealed]>
>
>> pt_pass = (char *) getpass ("Password:");
>> memset (user_pass, '\0', l_size);
>> strcpy (user_pass, pt_pass); // <- BAD CODE
>
> I could have used strlcpy but I assumed (and my reading of the FreeBSD
> source code confirm it) that getpass(3) was doing the size check.

This is why you shouldn't make such assumptions. Never assume someone else
validated your input. If you want to write secure code, assume every
function is under attack from every other function, because someday someone
will change the program flow, bypassing your carefully crafted validation
function and passing garbage to your insecure code. Outsourcing your
validation to other code is the software equivalent of the hard outside /
soft tasty center security model.

--
Carson

[ reply ]
Re: Calife heap corrupt / potential local root exploit Feb 27 2004 08:18PM
Ollivier Robert (roberto keltia freenix fr)


 

Privacy Statement
Copyright 2010, SecurityFocus