Posts

Showing posts with the label environment

scary eval to create the most safe environment ever

Are you worried about Array redefinition? Are you worried about eval function redefinition? Are you worried about whatever you want redefinition? STOP With the incredible eval feature "discovered" few days ago, it possible to create the most safe environment ever for every kind of purpose, starting from JSON evaluation, arriving to total protected native constructors . const safeEnvironment = function(A, B, D, F, N, O, R, S){ const Array = A, Boolean = B, Date = D, Function= F, Number = N, Object = O, RegExp = R, String = S, eval = function(String){ return self.eval("(" + String + ")"); }; return new function(){}; }( Array, Boolean, Date, Function, Number, Object, RegExp, String ); With above piece of code you can evaluate every kind of script without to be worried about common ...