@@ -92,9 +92,9 @@ export const secureLoad = (moduleInfo: NativeModuleInfo): Module["exports"] => {
9292
9393 const WebAssembly = new Proxy ( globalThis . WebAssembly , {
9494 get ( target , prop , receiver ) {
95- console . warn ( `[🛑Security🛑] " ${ fileName } " is loading WebAssembly (${ String ( prop ) } )!` ) ;
95+ console . warn ( `[🛑Security🛑] ' ${ fileName } ' is loading WebAssembly (${ String ( prop ) } )!` ) ;
9696 if ( ! isTrusted ( moduleInfo , "WebAssembly" , target ) ) {
97- throw new Error ( `[🛑Security🛑] Access Denied! User blocked 'WebAssembly' in '${ fileName } '` ) ;
97+ throw new Error ( `[🛑Security🛑] Access Denied! User blocked 'WebAssembly' ( ${ String ( prop ) } ) in '${ fileName } '` ) ;
9898 }
9999
100100 return Reflect . get ( target , prop , receiver ) ;
@@ -135,12 +135,13 @@ export const secureLoad = (moduleInfo: NativeModuleInfo): Module["exports"] => {
135135 argv : process . argv ,
136136
137137 debugProcess : ( ) => {
138- console . warn ( `[🛑Security🛑] "${ fileName } " is calling "process.debugProcess"` ) ;
139- // if (!isTrusted(fileName, "DebugProcess", "Debug the main process, gives full system access!", hash)) {
140- // throw new Error(`Access Denied! User blocked "process.debugProcess" in "${fileName}"`);
141- // }
142138 // @ts -expect-error This exists
143- process . _debugProcess ( process . pid ) ;
139+ const debugProcess : ( pid : number ) => void = process . _debugProcess ;
140+ console . warn ( `[🛑Security🛑] '${ fileName } ' is calling 'process.debugProcess'` ) ;
141+ if ( ! isTrusted ( moduleInfo , "DebugProcess" , debugProcess ) ) {
142+ throw new Error ( `[🛑Security🛑] Access Denied! User blocked 'process.debugProcess' in '${ fileName } '` ) ;
143+ }
144+ debugProcess ( process . pid ) ;
144145 return process . debugPort ;
145146 } ,
146147 } ;
0 commit comments