File tree Expand file tree Collapse file tree
javascript/ql/test/query-tests/Security/CWE-601/ClientSideUrlRedirect Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,15 +6,15 @@ window.location = /.*redirect=([^&]*).*/.exec(document.location.href)[1];
66 window . location = indirect . exec ( document . location . href ) [ 1 ] ;
77} ) ;
88
9- // NOT OK
9+ // NOT OK [INCONSISTENCY]
1010window . location = new RegExp ( '.*redirect=([^&]*).*' ) . exec ( document . location . href ) [ 1 ] ;
1111
1212( function ( ) {
1313 var indirect = new RegExp ( '.*redirect=([^&]*).*' )
1414 window . location = indirect . exec ( document . location . href ) [ 1 ] ;
1515} ) ;
1616
17- // NOT OK
17+ // NOT OK [INCONSISTENCY]
1818window . location = new RegExp ( / .* r e d i r e c t = ( [ ^ & ] * ) .* / ) . exec ( document . location . href ) [ 1 ] ;
1919
2020( function ( ) {
@@ -23,7 +23,7 @@ window.location = new RegExp(/.*redirect=([^&]*).*/).exec(document.location.href
2323} ) ;
2424
2525function foo ( win ) {
26- win . location . assign ( new RegExp ( / .* r e d i r e c t = ( [ ^ & ] * ) .* / ) . exec ( win . location . href ) [ 1 ] ) ; // NOT OK
26+ win . location . assign ( new RegExp ( / .* r e d i r e c t = ( [ ^ & ] * ) .* / ) . exec ( win . location . href ) [ 1 ] ) ; // NOT OK [INCONSISTENCY]
2727}
2828
29- foo ( window ) ;
29+ foo ( window ) ;
You can’t perform that action at this time.
0 commit comments