Last active
August 29, 2015 14:01
-
-
Save KevinMcHugh/fab941ec3677f9a19ee0 to your computer and use it in GitHub Desktop.
Tests for vulnerability to new Rails Unsafe Query Risk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://groups.google.com/forum/#!topic/rubyonrails-security/8CVoclw-Xkk | |
# be rails r test_for_query_risk_vuln.rb, no guarantee that it's perfect. | |
Rails.application.eager_load! | |
vulnerable = ActiveRecord::Base.descendants.map do |klass| | |
klass.to_s if klass.column_names.include? klass.to_s.underscore.pluralize | |
end.uniq | |
puts "Take a look at #{vulnerable}!!!!!!" unless vulnerable.compact.empty? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment