-1
$input = $_GET['name'];
eval("\$name= \"$input\";");

Or it is insecure? Thanks. Without any php functions, like preg_replace or any other, just working with user data as string type with \" when put it to eval function.

1 Answers1

3

This basically will allow the user to inject arbitrary code into your application. Think something in the line of

$input=";mysql_query(\"DROP TABLE users\")"

Also eval makes it basically impossible to cache anything but that is a minor consequence.

Christoph Grimmer
  • 4,210
  • 4
  • 40
  • 64