You are here: Re: Sending authentication mails « PHP Programming Language « IT news, forums, messages
Re: Sending authentication mails

Posted by Andy Hassall on 01/19/06 22:33

On 19 Jan 2006 20:17:02 GMT, Pedro Graca <hexkid@dodgeit.com> wrote:

> $sql = "update user_table set validated=1 where code='{$_GET['code']}'";

I'm sure you know better than to do this :-) SQL injection ahoy - remember to
escape appropriately, or use a library that implements (or at least emulates)
placeholders.

This is actually quite a good demonstration of SQL injection risks; you could
call the script as:

validate.php?code='+or+'a'%3d'a

... and it'll set validated=1 without the right code, as you end up with the
SQL as:

update user_table set validated=1 where code='' or 'a'='a'

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация