FilesSubmittedBranchesLabelsClientsUsersJobsHelp
Tree viewShow/hide recent activityInformation
Change 227

Change 227 by nullbyte@nullbyte-gentoo on 2005/10/30 23:50:17

strip <script> out of page bodies. someone (zz9) had an XSS in FrontPage within 3 hours of me mentioning the myspace worm at the pub.
Affected files ...
//depot/projects/wiki/app/models/page.rb#2 edittext
Differences ...

==== //depot/projects/wiki/app/models/page.rb#2 (text) ====

@@ -10,6 +10,8 @@
1010
1111 def to_html
1212 html = RedCloth.new(body.to_s).to_html
13 html.gsub!(/<\/?script[^>]*>/i, '')
14 html.gsub!(/\son\w+\s*=/i, ' x-nope=')
1315 html.gsub(WIKI_WORD) { "<a href=\"/wiki/show/#{$1}\">#{$1}</a>" }
1416 end
1517end

P4Web/LINUX26X86/2005.1/82295 · Copyright © 1995-2005 Perforce Software · ttul.org