Bug 26899 - XSSAuditor shouldn't strip control characters
Summary: XSSAuditor shouldn't strip control characters
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://xenon.stanford.edu/~collinj/t...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-01 13:21 PDT by Adam Barth
Modified: 2009-07-01 18:36 PDT (History)
2 users (show)

See Also:


Attachments
Patch with test (7.16 KB, patch)
2009-07-01 17:35 PDT, Daniel Bates
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2009-07-01 13:21:57 PDT
Test case:

https://xenon.stanford.edu/~collinj/test/ie8xss/xsstest.php?q=<script>alert(/XSS/)//h%01</script>
Comment 1 Daniel Bates 2009-07-01 17:35:09 PDT
Created attachment 32165 [details]
Patch with test

Upon further investigation, we need to remove null characters, since the HTMLTokenizer does in processing scripts (i.e. the contents of <script>al\0ert(1)</script> becomes alert(1) by the time it is passed to XSSAuditor). Let me know if this change is better addressed in a separate bug.
Comment 2 Adam Barth 2009-07-01 18:26:33 PDT
Comment on attachment 32165 [details]
Patch with test

Great patch.  Thanks.
Comment 3 Adam Barth 2009-07-01 18:36:18 PDT
Sending        LayoutTests/ChangeLog
Adding         LayoutTests/http/tests/security/xssAuditor/script-tag-control-char-expected.txt
Adding         LayoutTests/http/tests/security/xssAuditor/script-tag-control-char.html
Adding         LayoutTests/http/tests/security/xssAuditor/script-tag-null-char-expected.txt
Adding         LayoutTests/http/tests/security/xssAuditor/script-tag-null-char.html
Sending        WebCore/ChangeLog
Sending        WebCore/page/XSSAuditor.cpp
Sending        WebCore/page/XSSAuditor.h
Sending        WebCore/platform/network/ResourceResponseBase.cpp
Sending        WebCore/platform/network/ResourceResponseBase.h
Transmitting file data ..........
Committed revision 45461.