Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call_user_func() loses taint #30

Open
CashWilliams opened this issue Mar 11, 2016 · 1 comment
Open

call_user_func() loses taint #30

CashWilliams opened this issue Mar 11, 2016 · 1 comment

Comments

@CashWilliams
Copy link

Using call_user_func() and call_user_func_array() causes lose of taint value.

Example code:

<?php

$input = $_GET['in'];
$function = 'render';
// Send tainted variable to $function
$output = call_user_func($function, $input);

function render($input) {
  // $input is tainted
  if (is_tainted($input)) {
    print "Input is tainted<br>";
  }
  return $input;
}

// $output is tainted
if (is_tainted($output)) {
  print "Output is tainted<br>";
}

Output:

Input is tainted
@CashWilliams
Copy link
Author

I've cleaned up the code a bit and tried to PR a test which fails locally #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants