note 78196 deleted from function.eval by ezyang

From: Date: Wed, 03 Oct 2007 01:26:09 +0000
Subject: note 78196 deleted from function.eval by ezyang
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-131014@lists.php.net to get a copy of this message
Note Submitter: php at guyblade dot com ---- 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.

« previous php.notes (#131014) next »