Skip to content

Commit dfe3166

Browse files
fix(custom-block): sanitize failure output so it can't leak source workflow internals
1 parent 6f8ed0a commit dfe3166

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

apps/sim/executor/handlers/workflow/workflow-handler.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,19 @@ export class WorkflowBlockHandler implements BlockHandler {
336336
} catch (error: unknown) {
337337
logger.error(`Error executing child workflow ${workflowId}:`, error)
338338

339+
// Custom blocks are an invocation boundary: on failure the consumer must not
340+
// see the source workflow's name, nested error text (which names internal
341+
// blocks), trace spans, or execution result — the success path hides all of
342+
// these too. The real error is logged above for the publisher/ops; the
343+
// consumer gets only a generic failure attributed to the block they placed.
344+
if (isCustomBlock) {
345+
throw new ChildWorkflowError({
346+
message: 'Custom block execution failed',
347+
childWorkflowName: block.metadata?.name || 'Custom block',
348+
childWorkflowInstanceId: instanceId,
349+
})
350+
}
351+
339352
let childTraceSpans: WorkflowTraceSpan[] = []
340353
let executionResult: ExecutionResult | undefined
341354

0 commit comments

Comments
 (0)