Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(window as any).global = window;

I am new in typescript, and I have used on global var in polyfill.js

(window as any).global = window; 

So with security or XSS purpose is it vulnerable to use. Or should I remove to find another route? Thanks, techies.

like image 663
Anupam Maurya Avatar asked Jun 07 '18 06:06

Anupam Maurya


1 Answers

Given that global is set to the same value as window and window is still available if you remove global - global provides no additional means for XSS / security issues than is already available from window itself.

So if your question is whether (window as any).global = window; creates some new opportunity for a cross-site scripting attack; it doesn't.

like image 112
Fenton Avatar answered Nov 15 '22 05:11

Fenton