|
|
|
|
|
by xentronium
4909 days ago
|
|
http://www.insinuator.net/2013/01/rails-yaml/ Some explanation why YAML user input is evil. It works like this 1.9.3p327 :001 > id = YAML.load("--- !ruby/string:Arel::Nodes::SqlLiteral \"1 --\"\n") # if user input can contain arbitrary YAML
"1 --"
It looks like string, but it's not. 1.9.3p327 :002 > Keyword.where(:id => id).first
Keyword Load (0.3ms) SELECT `keywords`.* FROM `keywords` WHERE `keywords`.`id` = 1 -- LIMIT 1
|
|