note 78196 added to function.eval

From: Date: Tue, 02 Oct 2007 17:46:00 +0000
Subject: note 78196 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-130992@lists.php.net to get a copy of this message
The eval usage suggested below by nicolas may, in fact, execute something. if you give his eval_syntax the string "print 'in jail'; } else { ob_end_clean(); print 'free at last'; ob_start();" then you will see the string 'free at last' being printed. This could easily be replaced with something malicious if it is used wantonly. This problem could be prevented by checking to see that braces are balanced AND properly ordered as merely being balanced is insufficient to prevent the code from being executed. ---- Server IP: 209.41.74.194 Probable Submitter: 137.79.160.174 ---- Manual Page -- http://www.php.net/manual/en/function.eval.php Edit -- https://master.php.net/note/edit/78196 Del: integrated -- https://master.php.net/note/delete/78196/integrated Del: useless -- https://master.php.net/note/delete/78196/useless Del: bad code -- https://master.php.net/note/delete/78196/bad+code Del: spam -- https://master.php.net/note/delete/78196/spam Del: non-english -- https://master.php.net/note/delete/78196/non-english Del: in docs -- https://master.php.net/note/delete/78196/in+docs Del: other reasons-- https://master.php.net/note/delete/78196 Reject -- https://master.php.net/note/reject/78196 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130992) next »