From bc302a558907764bbe17707e299829bfa40ec6aa Mon Sep 17 00:00:00 2001 From: kwaroran Date: Wed, 29 Nov 2023 00:51:19 +0900 Subject: [PATCH] [fix] embededworker --- src/ts/plugins/embedworker.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ts/plugins/embedworker.ts b/src/ts/plugins/embedworker.ts index f7c172b4..6929b000 100644 --- a/src/ts/plugins/embedworker.ts +++ b/src/ts/plugins/embedworker.ts @@ -79,7 +79,7 @@ const whitelist = [ const evaluation = globaly.eval -const prop = Object.getOwnPropertyNames( globaly ) +const prop = Object.getOwnPropertyNames( globaly ).concat( Object.getOwnPropertyNames( this )) prop.push( //unsafe apis 'open', @@ -114,6 +114,16 @@ prop.forEach( function( prop ) { }); } catch (error) { } + try { + Object.defineProperty( this, prop, { + get : function() { + throw "Security Exception: cannot access "+prop; + return 1; + }, + configurable : false + }); + } catch (error) { + } } else{ }