Re: SQL Injection
- From: "Jacob" <nospam@xxxxxxxxxxxxx>
- Date: Thu, 15 Dec 2005 21:09:12 -0800
Make sure you always escape single quotes and other magic characters when
you enter data into your database. Always assume every field you get from
the user (form, url, or cookie based) has malicious data in it.
For example, say you had a form were users could update their email address
and you used the result from that to update the database with:
SQL.Text := format('update usertable set usr_email = '%s' where usr_id =
%d', [emailfield, idfield]);
Now if you didn't remove escape chars from the input, a user could possibly
set their email address to:
"GO delete * FROM systables'
Resulting in you running the query:
update usertable set usr_email = '' GO delete * from systables'
(notice the double single quote before the GO)
"VT Venkatesh" <venks@xxxxxxxx> wrote in message
news:43a228b0@xxxxxxxxxxxxxxxxxxxxxxxxx
> Can some one throw light on how to prevent SQL injection with Delphi
> 2005/2006
> Venkatesh
.
- Follow-Ups:
- Re: SQL Injection
- From: TObject
- Re: SQL Injection
- References:
- SQL Injection
- From: VT Venkatesh
- SQL Injection
- Prev by Date: Re: Got it: D2006 Pro - German
- Next by Date: Re: SQL Injection
- Previous by thread: Re: SQL Injection
- Next by thread: Re: SQL Injection
- Index(es):
Relevant Pages
|