note 75705 added to function.gethostbyaddr

From: Date: Tue, 12 Jun 2007 18:41:44 +0000
Subject: note 75705 added to function.gethostbyaddr
Groups: php.notes 
Request: Send a blank email to php-notes+get-127424@lists.php.net to get a copy of this message
I wonder if "SQL injection" is possible with a hostname. Does anyone know that, is it possible to manipulate a dns server to respond a domain name which contains an sql statement which allows sql injection? Example: $host = gethostbyaddr($_SERVER['REMOTE_ADDR']); mysql_query("INSERT INTO table (host) VALUES ('".$host."')"); Do we need addslashes? : $host = addslashes(gethostbyaddr($_SERVER['REMOTE_ADDR'])); Thanks for the answer ---- Server IP: 195.56.193.13 Probable Submitter: 84.0.254.24 ---- Manual Page -- http://www.php.net/manual/en/function.gethostbyaddr.php Edit -- https://master.php.net/note/edit/75705 Del: integrated -- https://master.php.net/note/delete/75705/integrated Del: useless -- https://master.php.net/note/delete/75705/useless Del: bad code -- https://master.php.net/note/delete/75705/bad+code Del: spam -- https://master.php.net/note/delete/75705/spam Del: non-english -- https://master.php.net/note/delete/75705/non-english Del: in docs -- https://master.php.net/note/delete/75705/in+docs Del: other reasons-- https://master.php.net/note/delete/75705 Reject -- https://master.php.net/note/reject/75705 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#127424) next »