Bug 26938 - XSSAuditor should accommodate common, slight transformations.
Summary: XSSAuditor should accommodate common, slight transformations.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: XSSAuditor
Depends on:
Blocks:
 
Reported: 2009-07-02 15:49 PDT by Matthew Murphy
Modified: 2009-07-22 16:28 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Murphy 2009-07-02 15:49:27 PDT
The reflective XSS filter landed in Bug #26199 is too strict in evaluating whether inputs were reflected back into the output.  If, for example, the server-side code does the equivalent of a PHP addslashes() on the input, then the following input will dodge the filter while still executing script:

<script>var bogus=/\/; alert(document.URL);</script>

The backslash will be doubled, resulting in an output that's subtly different than its input.

IE's filter accounts for such subtle differences between input and output using regular expressions, and perhaps we should do the same.
Comment 1 Daniel Bates 2009-07-08 00:36:44 PDT
Right. We are aware of this issue and it is among our list of improvements.
(In reply to comment #0)
> The reflective XSS filter landed in Bug #26199 is too strict in evaluating
> whether inputs were reflected back into the output.  If, for example, the
> server-side code does the equivalent of a PHP addslashes() on the input, then
> the following input will dodge the filter while still executing script:
> 
> <script>var bogus=/\/; alert(document.URL);</script>
> 
> The backslash will be doubled, resulting in an output that's subtly different
> than its input.
> 
> IE's filter accounts for such subtle differences between input and output using
> regular expressions, and perhaps we should do the same.
Comment 2 Adam Barth 2009-07-22 16:28:48 PDT
Dan fixed this in http://trac.webkit.org/changeset/46250