タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

SQLとrailsに関するSpring_MTのブックマーク (2)

  • Rails SQL Injection Examples

    Overview The Ruby on Rails web framework provides a library called ActiveRecord which provides an abstraction for accessing databases. This page lists many query methods and options in ActiveRecord which do not sanitize raw SQL arguments and are not intended to be called with unsafe user input. Careless use of these methods can open up code to SQL Injection exploits. The examples here do not inclu

  • ActiveRecordのSQLインジェクションパターン

    Last Updated on: 2018年10月7日Railsで多用されているActiveRecordのインジェクションパターンを簡単に紹介します。出典はrails-sqli.orgなのでより詳しい解説はこちらで確認してください。特に気をつける必要があると思われる物のみをピックアップしました。 Exists?メソッド User.exists? params[:user] params[:user]などの使い方は危険です。RailsPHPなどと同様にuser[]というパラメーターで配列化します。 ?user[]=1 が入力の場合、 SELECT 1 AS one FROM "users" WHERE (1) LIMIT 1 となり不正なクエリが実行されます。 Calculateメソッド CalculateメソッドはSQLの集約関数を実行するメソッドです。average、calculate

    ActiveRecordのSQLインジェクションパターン
  • 1