10000 Tests: Workaround failures in recent XSS tests in iOS 8 - 12 by mgol · Pull Request #4694 · jquery/jquery · GitHub
[go: up one dir, main page]

Skip to content

Tests: Workaround failures in recent XSS tests in iOS 8 - 12 #4694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Tests: Workaround failures in recent XSS tests in iOS 8 - 12
iOS 8-12 parses `<noembed>` tags differently, executing this code. This is no
different to native behavior on that OS, though, so just accept it.

Ref gh-4685
  • Loading branch information
mgol committed Apr 29, 2020
commit 03d34a5a8a859309ea01e83a0d30bae3563b57be
22 changes: 15 additions & 7 deletions test/unit/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,8 @@ QUnit.test( "Sanitized HTML doesn't get unsanitized", function( assert ) {

var container,
counter = 0,
assertCount = 13,
oldIos = /iphone os (?:8|9|10|11|12)_/i.test( navigator.userAgent ),
assertCount = oldIos ? 12 : 13,
done = assert.async( assertCount );

assert.expect( assertCount );
Expand Down Expand Up @@ -2954,10 +2955,17 @@ QUnit.test( "Sanitized HTML doesn't get unsanitized", function( assert ) {
test( "<title><title /><img src=url404 onerror=xss(4)>" );
test( "<iframe><iframe/><img src=url404 onerror=xss(5)>" );
test( "<noframes><noframes/><img src=url404 onerror=xss(6)>" );
test( "<noembed><noembed/><img src=url404 onerror=xss(7)>" );
test( "<noscript><noscript/><img src=url404 onerror=xss(8)>" );
test( "<foo\" alt=\"\" title=\"/><img src=url404 onerror=xss(9)>\">" );
test( "<img alt=\"<x\" title=\"\" src=\"/><img src=url404 onerror=xss(10)>\">" );
test( "<noscript/><img src=url404 onerror=xss(11)>" );
test( "<option><style></option></select><img src=url404 onerror=xss(12)></style>" );
test( "<noscript><noscript/><img src=url404 onerror=xss(7)>" );
test( "<foo\" alt=\"\" title=\"/><img src=url404 onerror=xss(8)>\">" );
test( "<img alt=\"<x\" title=\"\" src=\"/><img src=url404 onerror=xss(9)>\">" );
test( "<noscript/><img src=url404 onerror=xss(10)>" );

test( "<option><style></option></select><img src=url404 onerror=xss(11)></style>" );

// Support: iOS 8 - 12 only.
// Old iOS parses `<noembed>` tags differently, executing this code. This is no
// different to native behavior on that OS, though, so just accept it.
if ( !oldIos ) {
test( "<noembed><noembed/><img src=url404 onerror=xss(12)>" );
}
} );
0