Changeset 194979 in webkit


Ignore:
Timestamp:
Jan 13, 2016 1:20:38 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[XSS Auditor] Do not include trailing comment characters in JavaScript snippets
https://bugs.webkit.org/show_bug.cgi?id=152873

Patch by Daniel Bates <dabates@apple.com> on 2016-01-13
Reviewed by Brent Fulgham.

Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
<https://src.chromium.org/viewvc/blink?view=rev&revision=169967>

Source/WebCore:

Test: http/tests/security/xssAuditor/script-tag-with-injected-comment.html

  • html/parser/XSSAuditor.cpp:

(WebCore::XSSAuditor::decodedSnippetForJavaScript):

LayoutTests:

  • http/tests/security/xssAuditor/script-tag-with-injected-comment-expected.txt: Added.
  • http/tests/security/xssAuditor/script-tag-with-injected-comment.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r194978 r194979  
     12016-01-13  Daniel Bates  <dabates@apple.com>
     2
     3        [XSS Auditor] Do not include trailing comment characters in JavaScript snippets
     4        https://bugs.webkit.org/show_bug.cgi?id=152873
     5
     6        Reviewed by Brent Fulgham.
     7
     8        Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
     9        <https://src.chromium.org/viewvc/blink?view=rev&revision=169967>
     10
     11        * http/tests/security/xssAuditor/script-tag-with-injected-comment-expected.txt: Added.
     12        * http/tests/security/xssAuditor/script-tag-with-injected-comment.html: Added.
     13
    1142016-01-13  Daniel Bates  <dabates@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r194968 r194979  
     12016-01-13  Daniel Bates  <dabates@apple.com>
     2
     3        [XSS Auditor] Do not include trailing comment characters in JavaScript snippets
     4        https://bugs.webkit.org/show_bug.cgi?id=152873
     5
     6        Reviewed by Brent Fulgham.
     7
     8        Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
     9        <https://src.chromium.org/viewvc/blink?view=rev&revision=169967>
     10
     11        Test: http/tests/security/xssAuditor/script-tag-with-injected-comment.html
     12
     13        * html/parser/XSSAuditor.cpp:
     14        (WebCore::XSSAuditor::decodedSnippetForJavaScript):
     15
    1162016-01-13  Adam Bergkvist  <adam.bergkvist@ericsson.com>
    217
  • trunk/Source/WebCore/html/parser/XSSAuditor.cpp

    r194819 r194979  
    671671        for (foundPosition = startPosition; foundPosition < endPosition; foundPosition++) {
    672672            if (!request.shouldAllowCDATA) {
    673                 if (startsSingleLineCommentAt(string, foundPosition) || startsMultiLineCommentAt(string, foundPosition)) {
    674                     foundPosition += 2;
    675                     break;
    676                 }
    677                 if (startsHTMLCommentAt(string, foundPosition)) {
    678                     foundPosition += 4;
     673                if (startsSingleLineCommentAt(string, foundPosition)
     674                    || startsMultiLineCommentAt(string, foundPosition)
     675                    || startsHTMLCommentAt(string, foundPosition)) {
    679676                    break;
    680677                }
Note: See TracChangeset for help on using the changeset viewer.