Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::providerTestCompileWithSqlInjectionForOperator()
  2. 9 core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::providerTestCompileWithSqlInjectionForOperator()

File

core/tests/Drupal/Tests/Core/Database/ConditionTest.php, line 176

Class

ConditionTest
@coversDefaultClass \Drupal\Core\Database\Query\Condition

Namespace

Drupal\Tests\Core\Database

Code

public static function providerTestCompileWithSqlInjectionForOperator() {
  $data = [];
  $data[] = [
    "IS NOT NULL) ;INSERT INTO {test} (name) VALUES ('test12345678'); -- ",
  ];
  $data[] = [
    "IS NOT NULL) UNION ALL SELECT name, pass FROM {users_field_data} -- ",
  ];
  $data[] = [
    "IS NOT NULL) UNION ALL SELECT name FROM {TEST_UPPERCASE} -- ",
  ];
  $data[] = [
    "= 1 UNION ALL SELECT password FROM user WHERE uid =",
  ];
  return $data;
}