Changeset 93561 in webkit


Ignore:
Timestamp:
Aug 22, 2011 4:52:37 PM (13 years ago)
Author:
abarth@webkit.org
Message:

HTMLSourceTracker crashes when network packets break poorly
https://bugs.webkit.org/show_bug.cgi?id=66728

Reviewed by Darin Adler.

Source/WebCore:

If there is a network packet boundary in the middle of an attribute
that begins with the letters "on", then the HTMLSourceTracker will get
confused and try to extract too many characters from future input. If
the future input is small enough, that will walk off the end of the
input and crash.

Test: http/tests/security/xssAuditor/crash-while-loading-tag-with-pause.html

  • html/parser/HTMLSourceTracker.cpp:

(WebCore::HTMLSourceTracker::sourceForToken):

LayoutTests:

Test that we don't crash when we get a bad network packet boundary.

  • http/tests/security/xssAuditor/crash-while-loading-tag-with-pause-expected.txt: Added.
  • http/tests/security/xssAuditor/crash-while-loading-tag-with-pause.html: Added.
  • http/tests/security/xssAuditor/resources/tag-with-pause.php: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r93556 r93561  
     12011-08-22  Adam Barth  <abarth@webkit.org>
     2
     3        HTMLSourceTracker crashes when network packets break poorly
     4        https://bugs.webkit.org/show_bug.cgi?id=66728
     5
     6        Reviewed by Darin Adler.
     7
     8        Test that we don't crash when we get a bad network packet boundary.
     9
     10        * http/tests/security/xssAuditor/crash-while-loading-tag-with-pause-expected.txt: Added.
     11        * http/tests/security/xssAuditor/crash-while-loading-tag-with-pause.html: Added.
     12        * http/tests/security/xssAuditor/resources/tag-with-pause.php: Added.
     13
    1142011-08-22  Peter Kasting  <pkasting@google.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r93559 r93561  
     12011-08-22  Adam Barth  <abarth@webkit.org>
     2
     3        HTMLSourceTracker crashes when network packets break poorly
     4        https://bugs.webkit.org/show_bug.cgi?id=66728
     5
     6        Reviewed by Darin Adler.
     7
     8        If there is a network packet boundary in the middle of an attribute
     9        that begins with the letters "on", then the HTMLSourceTracker will get
     10        confused and try to extract too many characters from future input.  If
     11        the future input is small enough, that will walk off the end of the
     12        input and crash.
     13
     14        Test: http/tests/security/xssAuditor/crash-while-loading-tag-with-pause.html
     15
     16        * html/parser/HTMLSourceTracker.cpp:
     17        (WebCore::HTMLSourceTracker::sourceForToken):
     18
    1192011-08-22  Eric Seidel  <eric@webkit.org>
    220
  • trunk/Source/WebCore/html/parser/HTMLSourceTracker.cpp

    r93281 r93561  
    6161    source.reserveCapacity(length);
    6262    source.append(m_sourceFromPreviousSegments);
     63    length -= m_sourceFromPreviousSegments.length();
    6364    for (int i = 0; i < length; ++i) {
    6465        source.append(*m_source);
Note: See TracChangeset for help on using the changeset viewer.