8000 Tests: Workaround failures in recent XSS tests in iOS 8 - 12 · mgol/jquery@03d34a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03d34a5

Browse files
committed
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 jquerygh-4685
1 parent dc06d68 commit 03d34a5

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

test/unit/manipulation.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,7 +2917,8 @@ QUnit.test( "Sanitized HTML doesn't get unsanitized", function( assert ) {
29172917

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

29232924
assert.expect( assertCount );
@@ -2954,10 +2955,17 @@ QUnit.test( "Sanitized HTML doesn't get unsanitized", function( assert ) {
29542955
test( "<title><title /><img src=url404 onerror=xss(4)>" );
29552956
test( "<iframe><iframe/><img src=url404 onerror=xss(5)>" );
29562957
test( "<noframes><noframes/><img src=url404 onerror=xss(6)>" );
2957-
test( "<noembed><noembed/><img src=url404 onerror=xss(7)>" );
2958-
test( "<noscript><noscript/><img src=url404 onerror=xss(8)>" );
2959-
test( "<foo\" alt=\"\" title=\"/><img src=url404 onerror=xss(9)>\">" );
2960-
test( "<img alt=\"<x\" title=\"\" src=\"/><img src=url404 onerror=xss(10)>\">" );
2961-
test( "<noscript/><img src=url404 onerror=xss(11)>" );
2962-
test( "<option><style></option></select><img src=url404 onerror=xss(12)></style>" );
2958+
test( "<noscript><noscript/><img src=url404 onerror=xss(7)>" );
2959+
test( "<foo\" alt=\"\" title=\"/><img src=url404 onerror=xss(8)>\">" );
2960+
test( "<img alt=\"<x\" title=\"\" src=\"/><img src=url404 onerror=xss(9)>\">" );
2961+
test( "<noscript/><img src=url404 onerror=xss(10)>" );
2962+
2963+
test( "<option><style></option></select><img src=url404 onerror=xss(11)></style>" );
2964+
2965+
// Support: iOS 8 - 12 only.
2966+
// Old iOS parses `<noembed>` tags differently, executing this code. This is no
2967+
// different to native behavior on that OS, though, so just accept it.
2968+
if ( !oldIos ) {
2969+
test( "<noembed><noembed/><img src=url404 onerror=xss(12)>" );
2970+
}
29632971
} );

0 commit comments

Comments
 (0)
0