提交 87fe19d6 编写于 作者: J Justin Collins

Do not ignore targets of #to_s in SQL

Should fix #638
上级 2994bb51
......@@ -431,6 +431,8 @@ class Brakeman::CheckSQL < Brakeman::BaseCheck
unless IGNORE_METHODS_IN_SQL.include? exp.method
if has_immediate_user_input? exp or has_immediate_model? exp
exp
elsif exp.method == :to_s
find_dangerous_value exp.target, ignore_hash
else
check_call exp
end
......
......@@ -12,4 +12,9 @@ class User < ActiveRecord::Base
def symbol_stuff
self.where(User.table_name.to_sym)
end
def self.get_all_countries(locale)
q = "country_#{locale} ASC".to_s
c = User.order(q)
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册