|
Secure Programming
RE: Are bad developer libraries the problem with M$ software? Nov 16 2002 01:00AM Michael Howard (mikehow microsoft com) (2 replies) RE: Are bad developer libraries the problem with M$ software? Nov 16 2002 07:03PM Frank Knobbe (fknobbe knobbeits com) (3 replies) Re: Are bad developer libraries the problem with M$ software? Nov 18 2002 07:36PM Casper Dik (Casper Dik Sun COM) (1 replies) Re: Are bad developer libraries the problem with M$ software? Nov 18 2002 11:10PM Andrew Griffiths (andrewg d2 net au) (1 replies) Re: Are bad developer libraries the problem with M$ software? Nov 19 2002 03:25AM Frank Knobbe (fknobbe knobbeits com) (3 replies) Re: Are bad developer libraries the problem with M$ software? Mar 22 2003 09:56AM Casper Dik (Casper Dik Sun COM) Re: Are bad developer libraries the problem with M$ software? Nov 19 2002 10:57PM Andrew Dalgleish (secprog andrewdalgleish dyndns org) (2 replies) Re: Are bad developer libraries the problem with M$ software? Nov 22 2002 03:31PM Frank Knobbe (fknobbe knobbeits com) Re: Are bad developer libraries the problem with M$ software? Nov 22 2002 07:11AM Valdis Kletnieks vt edu Re: Are bad developer libraries the problem with M$ software? Nov 18 2002 11:22PM Andrew Griffiths (andrewg d2 net au) Re: Are bad developer libraries the problem with M$ software? Nov 18 2002 06:54PM John Viega (viega securesoftware com) (2 replies) Re: Are bad developer libraries the problem with M$ software? Nov 18 2002 09:46PM Frank Knobbe (fknobbe knobbeits com) (1 replies) Re: Are bad developer libraries the problem with M$ software? Nov 19 2002 09:31AM Steffen Dettmer (steffen dett de) (1 replies) Re: Are bad developer libraries the problem with M$ software? Nov 22 2002 03:35PM Tim van Erven (tripudium chello nl) Re: Are bad developer libraries the problem with M$ software? Nov 18 2002 06:26PM Götz Babin-Ebell (babinebell trustcenter de) |
|
|
Privacy Statement |
> developers."*
Perl's print statement is safe, right? No buffer overflows *there*...
print 'Hello, '.$query->param('name');
Except now I'm vulnerable to cross-site scripting :)
apl
----- Original Message -----
From: "Michael Howard" <mikehow (at) microsoft (dot) com [email concealed]>
To: <phani (at) myrealbox (dot) com [email concealed]>; <secprog (at) securityfocus (dot) com [email concealed]>
Sent: Friday, November 15, 2002 7:00 PM
Subject: RE: Are bad developer libraries the problem with M$ software?
"There is no such thing as dangerous functions, only dangerous
developers."*
"secure" functions are a complete crok - there is no such thing... There
are some functions that help you get things right, but they do not lead
to secure code... Anyone who thinks they can do away with the
"dangerous" functions and replace them with the "safe" 'n' versions (ie;
strcpy -> strncpy) is kidding themselves.
The issue is the DATA, not the code. Do you trust the data? You need to
determine at which point in the code is the data well-formed and
correct. The ONLY way to build secure code is to question the
assumptions about the trustworthiness of the data as it crosses
untrusted to trusted boundaries, not hunting down "insecure" functions.
Here's an example: wassup with this code?
#define MAXSTRLEN(x) (sizeof(x)/sizeof(x[0]))
if (bstrURL != NULL) {
WCHAR szTmp[MAX_PATH];
LPCWSTR szExtSrc;
LPWSTR szExtDst;
wcsncpy( szTmp, bstrURL, MAXSTRLEN(szTmp) );
szTmp[MAXSTRLEN(szTmp)] = 0;
szExtSrc = wcsrchr( bstrURL, '.' );
szExtDst = wcsrchr( szTmp , '.' );
if(szExtDst) {
szExtDst[0] = 0;
if(m_inst.m_fDesktop) {
wcsncat( szTmp, L"__DESKTOP", MAXSTRLEN(szTmp) );
wcsncat( szTmp, szExtSrc , MAXSTRLEN(szTmp) );
It's secure, right? 'coz I'm using the 'secure' 'n' versions!!!? No,
it's not.. I'll leave that as an exercise for the reader
* there is one function that is impossible to use securely -> gets() :-)
Cheers, Michael
Secure Windows Initiative
Writing Secure Code
http://www.microsoft.com/mspress/books/5612.asp
[ reply ]