Created
October 13, 2011 19:09
-
-
Save grantr/1285189 to your computer and use it in GitHub Desktop.
script to find rails 3 xss issues
This file contains 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
# run from rails root | |
Dir.glob("app/views/**/*.*").each do |filename| | |
File.open(filename) do |f| | |
f.each_with_index do |line, i| | |
line.scan /[^"]"([^"]+)"/ do |match| | |
m = match.first | |
puts "#{f.path} :#{i+1} #{m}" if m =~ /(<[^%]|[^=%]>)/ | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment