23. STEP 5 ③防止方法、④参考資料:SQLインジェクションの防止
3.学生が活用した OWASP Top10 A1:2017
Parameterized Query Examples
SQL Injection is best prevented through the use of parameterized
queries. The following chart demonstrates, with real-world code
samples, how to build parameterized queries in most of the common
web languages. The purpose of these code samples is to
demonstrate to the web developer how to avoid SQL Injection when
building database queries within a web application.
パラメータ化されたクエリの例
SQLインジェクションは、 パラメータ化されたクエリを使用するこ
とで最も効果的に防止されます 。 次の図は、実際のコードサンプ
ルを使用して、一般的なWeb言語のほとんどでパラメータ化された
クエリを構築する方法を示しています。 これらのコードサンプルの
目的は、Webアプリケーション内でデータベースクエリを構築する
際にSQLインジェクションを回避する方法をWeb開発者に実証する
ことです。
24. STEP 6 対策の実施
3.学生が活用した OWASP Top10 A1:2017
$sql = “select email from account_t where uid = :userid
and pw = :password ”;
$st->bindValue(“:userid”,$uid);
$st->bindValue(“:password”,$pw);
$st->execute();