From 481776245c71d2e5d5a2fecac7b87744ca997d2c Mon Sep 17 00:00:00 2001 From: m0rs3c0d3 Date: Sat, 21 Feb 2026 14:29:25 -0800 Subject: [PATCH] Potential fix for code scanning alert no. 12: Unvalidated dynamic method call Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/core/workflow/WorkflowEngine.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/workflow/WorkflowEngine.ts b/src/core/workflow/WorkflowEngine.ts index 17e079d..bdf73d6 100644 --- a/src/core/workflow/WorkflowEngine.ts +++ b/src/core/workflow/WorkflowEngine.ts @@ -144,6 +144,10 @@ export class WorkflowEngine { context: NodeContext, timeout?: number ): Promise { + if (typeof handler !== 'function') { + throw new Error('Invalid node handler: expected function'); + } + if (!timeout) { return handler(node, context); }