1313 scrpt2 . src = 'http://www.cdn.local/ga.js' ;
1414 scrpt2 . integrity = 'sha256-h0UuK3mE9taiYlB5u9vT9A0s/XDgkfVd+F4VhN/sky=' ;
1515
16- var scrpt3 = document . createElement ( 'script' ) ; // $ Alert - http + ternary
16+ var scrpt3 = document . createElement ( 'script' ) ;
1717 scrpt3 . type = 'text/javascript' ;
18- scrpt3 . src = ( 'https:' == document . location . protocol ? 'http://unsafe' : 'http://also-unsafe' ) + '.cdn.local/ga.js' ;
18+ scrpt3 . src = ( 'https:' == document . location . protocol ? 'http://unsafe' : 'http://also-unsafe' ) + '.cdn.local/ga.js' ; // $ Alert[js/functionality-from-untrusted-source] - http + ternary
1919
20- var ifrm = document . createElement ( 'iframe' ) ; // $ Alert - http URL
21- ifrm . src = 'http://www.example.com/' ;
20+ var ifrm = document . createElement ( 'iframe' ) ;
21+ ifrm . src = 'http://www.example.com/' ; // $ Alert[js/functionality-from-untrusted-source] - http URL
2222
2323 // OK - https URL
2424 var ifrm2 = document . createElement ( 'iframe' ) ;
2525 ifrm2 . src = 'https://www.example.com/' ;
2626
27- function getUrl ( version ) { // $ Alert - http URL tracked through calls
27+ function getUrl ( version ) {
2828 return 'http://www.cdn.local/' + version + '/ga.js' ;
2929 }
3030 var ifrm3 = document . createElement ( 'iframe' ) ;
31- ifrm3 . src = getUrl ( 'v123' ) ;
31+ ifrm3 . src = getUrl ( 'v123' ) ; // $ Alert[js/functionality-from-untrusted-source] - http URL tracked through calls
3232
33- var ifrm4 = document . createElement ( 'iframe' ) ; // $ Alert - assignment of bad URL using setAttribute
34- ifrm4 . setAttribute ( 'src' , 'http://www.example.local/page.html' ) ;
33+ var ifrm4 = document . createElement ( 'iframe' ) ;
34+ ifrm4 . setAttribute ( 'src' , 'http://www.example.local/page.html' ) ; // $ Alert[js/functionality-from-untrusted-source] - assignment of bad URL using setAttribute
3535
3636 // OK - bad URL, but the attribute is not `src`
3737 var ifrm5 = document . createElement ( 'iframe' ) ;
4242 < body >
4343 hello
4444 </ body >
45- </ html >
45+ </ html >
0 commit comments