This commit is contained in:
NoLogicAlan committed 2026-09-11 03:57:06 +03:00
1 parent 3043a755ee
commit 7f1d076902
17 files changed
+944 -46

No files matched your search

+1 -5
View File
@@ -158,10 +158,6 @@ async function runEval(expression, context) {
? `return (${expression});`
: expression;
// Build the async function via the AsyncFunction constructor instead of eval(),
// and shadow dangerous globals as parameters so evaluated code cannot trivially
// reach the Node.js runtime (require, process.binding, etc.) even if owner
// credentials are compromised.
const AsyncFunction = Object.getPrototypeOf(async function() {}).constructor;
result = await new AsyncFunction("process", "require", "module", "global", "globalThis", "__dirname", "__filename", code).call(context);
type = result === null ? "null" : typeof result;
@@ -315,4 +311,4 @@ export async function run(msg, data) {
});
resetTimer();
}
}