Using User Input Directly in call_user_func() or Variable Functions
PHP applications accept user-controlled input specifying function names and directly pass them to call_user_func(), call_user_func_array(), or variable function syntax without validation. Code patterns like call_user_func($_GET['function'], $args) or $func = $_POST['callback']; $func($data); treat user input as trusted function identifiers, allowing attackers to specify arbitrary PHP functions including dangerous system functions (system(), exec(), shell_exec(), passthru(), proc_open()), file manipulation functions (unlink(), file_put_contents(), fopen()), or even eval() and assert() for code execution. Variable function syntax where function names come from variables: $functionName = $_REQUEST['action']; $result = $functionName($parameters); is particularly dangerous because it looks innocuous but executes arbitrary code when attackers control $functionName. Array callback syntax: call_user_func([$object, $_GET['method']], $args) allows method invocation on objects where attackers control the method name, potentially calling magic methods (__destruct(), __toString(), __call()) that trigger unintended side effects or security vulnerabilities. The vulnerability extends to indirect user control where database records, configuration files, or API responses containing attacker-influenced data determine callable names. Even seemingly safe wrapper functions that internally use call_user_func() become vulnerable when parameters flow from user input without validation.