Hack Forums
[PHP] Possible Tricky Function Injection - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43)
+----- Forum: SQL Injection Attacks (https://hackforums.net/forumdisplay.php?fid=103)
+----- Thread: [PHP] Possible Tricky Function Injection (/showthread.php?tid=6002276)



[PHP] Possible Tricky Function Injection - ipkdanny - Aug 26, 2019

I've been racking my head trying to find some sort of vulnerability with this code snippet.

The idea is that a function is specified in query string parameters and is retrieved through $_REQUEST (the $a array in this case), and then executed with the array contents as the paramter. I've been going through the standard PHP functions but the fact that an array is being passed to the function makes this difficult and tricky.

PHP Code

<?php

// someArg=value&model=function_to_call
$a = array(
 
   'someArg' => 'value',
 
   'model' => 'function_to_call');

$model = $a['model'];
$model($a);

?>

Can anybody think of a vulnerability here, or is this code practically safe?

Edit: Woops...just realized this is in the SQLi section. My bad, but I blame the misleading breadcrumbs on Hack Forums - SQL Injection Attacks 🤫