エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
MySQLで秘密のトークンを0と比較したら危険だけど AR (>= 3.2.12) 経由なら安全 #MySQL #Rails #ActiveRecord - Qiita
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
MySQLで秘密のトークンを0と比較したら危険だけど AR (>= 3.2.12) 経由なら安全 #MySQL #Rails #ActiveRecord - Qiita
User.create!(:token => "c4a307708d83f6af91daee857a089587") User.where(:token => 0) # => [#<User i... User.create!(:token => "c4a307708d83f6af91daee857a089587") User.where(:token => 0) # => [#<User id: 1, token: "c4a307708d83f6af91daee857a089587">] 秘密のtokenに 0 で比較するとレコードが出てくる。 MySQLだと 'a' = 0 は 'a'.to_f == 0 相当をやってるっぽい。
2012/12/03 リンク