@@ -11,27 +11,30 @@ import { UNIVERSAL_NAV_URL } from './config/constants'
11
11
ReactDOM . render ( < App /> , document . getElementById ( 'root' ) )
12
12
13
13
// <!-- Start of topcoder Topcoder Universal Navigation script -->
14
- // eslint-disable-next-line no-unused-expressions
15
- ! ( function ( n , t , e , a , c , i , o ) {
16
- // eslint-disable-next-line no-unused-expressions, no-sequences
17
- ; ( n [ 'TcUnivNavConfig' ] = c ) ,
18
- ( n [ c ] =
19
- n [ c ] ||
20
- function ( ) {
21
- ; ( n [ c ] . q = n [ c ] . q || [ ] ) . push ( arguments )
22
- } ) ,
23
- ( n [ c ] . l = 1 * new Date ( ) )
14
+ // SAST/open-redirect handling: make sure script hostname matches what we expect
15
+ if ( ( new URL ( UNIVERSAL_NAV_URL ) ) . hostname . match ( / u n i - n a v .t o p c o d e r ( - d e v ) ? .c o m $ / i) ) {
16
+ // eslint-disable-next-line no-unused-expressions
17
+ ! ( function ( n , t , e , a , c , i , o ) {
24
18
// eslint-disable-next-line no-unused-expressions, no-sequences
25
- ; ( i = t . createElement ( e ) ) , ( o = t . getElementsByTagName ( e ) [ 0 ] )
26
- i . async = 1
27
- i . type = 'module'
28
- i . src = a
29
- o . parentNode . insertBefore ( i , o )
30
- } ) (
31
- window ,
32
- document ,
33
- 'script' ,
34
- UNIVERSAL_NAV_URL ,
35
- 'tcUniNav'
36
- )
19
+ ; ( n [ 'TcUnivNavConfig' ] = c ) ,
20
+ ( n [ c ] =
21
+ n [ c ] ||
22
+ function ( ) {
23
+ ; ( n [ c ] . q = n [ c ] . q || [ ] ) . push ( arguments )
24
+ } ) ,
25
+ ( n [ c ] . l = 1 * new Date ( ) )
26
+ // eslint-disable-next-line no-unused-expressions, no-sequences
27
+ ; ( i = t . createElement ( e ) ) , ( o = t . getElementsByTagName ( e ) [ 0 ] )
28
+ i . async = 1
29
+ i . type = 'module'
30
+ i . src = a
31
+ o . parentNode . insertBefore ( i , o )
32
+ } ) (
33
+ window ,
34
+ document ,
35
+ 'script' ,
36
+ UNIVERSAL_NAV_URL ,
37
+ 'tcUniNav'
38
+ )
39
+ }
37
40
// <!-- End of topcoder Topcoder Universal Navigation script -->
0 commit comments