![]() Topic awaiting preservation: PHP injection security? (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Australia |
![]() Hi all... code: $myVar = $_POST['myVar'];
code: print $myVar . 'contains invalid characters, please try again';
|
Bipolar (III) Inmate From: Australia |
![]() Or is it only a security issue if you use eval() ? |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() That would only be an issue if you were using eval(), but, you're always open to cross site scripting if you don't php->htmlentity() everything you output (preferably: When you output it). code: $obj = new $var ( ... );
code: $obj = eval('return new '. get_class($this). '();');
|
Bipolar (III) Inmate From: Australia |
![]() Thanks TP, |
Bipolar (III) Inmate From: Australia |
![]() So just to clarify... |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() Globals overwrite - in case your code ever runs under a system with register globals on. |
Bipolar (III) Inmate From: Australia |
![]() Cool thanks, yeh I turn register globals off in htaccess, but i have never actually used registered globals anyway. |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() TP |
Bipolar (III) Inmate From: Australia |
![]() Actually i can't remember what I was reading but they said you shouldn't store htmlentitied data in your database. Its meant to be used for the html you are about to output, purely so that certain characters (say quotes ") show up. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() because one of these day, you might wish to do something else with the data in your database - and then the entitites are going to be a hazzle. |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Makes sense. |