提交 cbef5621 编写于 作者: J Justin Collins

Detect Rails 3 json escape config option

上级 3165ca4b
......@@ -62,6 +62,12 @@ class Brakeman::CheckCrossSiteScripting < Brakeman::BaseCheck
initializers = tracker.check_initializers :ActiveSupport, :escape_html_entities_in_json=
initializers.each {|result| json_escape_on = true?(result.call.first_arg) }
if tracker.config[:rails][:active_support] and
true? tracker.config[:rails][:active_support][:escape_html_entities_in_json]
json_escape_on = true
end
if !json_escape_on or version_between? "0.0.0", "2.0.99"
@known_dangerous << :to_json
Brakeman.debug("Automatic to_json escaping not enabled, consider to_json dangerous")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册