<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,11 @@
 Sanitize History
 ================================================================================
 
+Version 1.0.4 (2009-01-16)
+  * Fixed a bug that made it possible to sneak a non-whitelisted element through
+    by repeating it several times in a row. All versions of Sanitize prior to
+    1.0.4 are vulnerable. [Reported by Cristobal]
+
 Version 1.0.3 (2009-01-15)
   * Fixed a bug whereby incomplete Unicode or hex entities could be used to
     prevent non-whitelisted protocols from being cleaned. Since IE6 and Opera</diff>
      <filename>HISTORY</filename>
    </modified>
    <modified>
      <diff>@@ -84,7 +84,7 @@ class Sanitize
   def clean!(html)
     fragment = Hpricot(html)
 
-    fragment.traverse_element do |node|
+    fragment.search('*') do |node|
       if node.bogusetag? || node.doctype? || node.procins? || node.xmldecl?
         node.swap('')
         next</diff>
      <filename>lib/sanitize.rb</filename>
    </modified>
    <modified>
      <diff>@@ -106,6 +106,10 @@ describe 'Config::DEFAULT' do
     Sanitize.clean(&quot;Don&amp;apos;t tas&amp;eacute; me &amp;amp; bro!&quot;).should.equal(&quot;Don&amp;apos;t tas&amp;eacute; me &amp;amp; bro!&quot;)
   end
 
+  should 'not choke on several instances of the same element in a row' do
+    Sanitize.clean('&lt;img src=&quot;http://www.google.com/intl/en_ALL/images/logo.gif&quot;&gt;&lt;img src=&quot;http://www.google.com/intl/en_ALL/images/logo.gif&quot;&gt;&lt;img src=&quot;http://www.google.com/intl/en_ALL/images/logo.gif&quot;&gt;&lt;img src=&quot;http://www.google.com/intl/en_ALL/images/logo.gif&quot;&gt;').should.equal('')
+  end
+
   strings.each do |name, data|
     should &quot;clean #{name} HTML&quot; do
       Sanitize.clean(data[:html]).should.equal(data[:default])</diff>
      <filename>test/spec_sanitize.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>152999220c4d3167b8a850f5fede97e3152380e2</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Grove</name>
    <email>ryan@wonko.com</email>
  </author>
  <url>http://github.com/rgrove/sanitize/commit/c00234abcf01a57788835ec74ad6552c3e3c2590</url>
  <id>c00234abcf01a57788835ec74ad6552c3e3c2590</id>
  <committed-date>2009-01-16T15:40:11-08:00</committed-date>
  <authored-date>2009-01-16T15:40:11-08:00</authored-date>
  <message>Fix a bug that made it possible to sneak a non-whitelisted element through by repeating it several times in a row. All versions of Sanitize prior to 1.0.4 are vulnerable. [Reported by Cristobal]</message>
  <tree>268750e1e9defaf137ce51b368a92b8977dcc17b</tree>
  <committer>
    <name>Ryan Grove</name>
    <email>ryan@wonko.com</email>
  </committer>
</commit>
