fix(security): block env depth-overflow approval bypass

This commit is contained in:
Peter Steinberger
2026-02-25 00:13:33 +00:00
parent 1970a1e9e5
commit 57c9a18180
4 changed files with 137 additions and 0 deletions

View File

@@ -478,6 +478,17 @@ export function resolveDispatchWrapperExecutionPlan(
}
current = unwrap.argv;
}
if (wrappers.length >= maxDepth) {
const overflow = unwrapKnownDispatchWrapperInvocation(current);
if (overflow.kind === "blocked" || overflow.kind === "unwrapped") {
return {
argv: current,
wrappers,
policyBlocked: true,
blockedWrapper: overflow.wrapper,
};
}
}
return { argv: current, wrappers, policyBlocked: false };
}