diff --git a/server/libs/modules/task-dispatchers/condition/src/main/java/com/bytechef/task/dispatcher/condition/util/ConditionTaskUtils.java b/server/libs/modules/task-dispatchers/condition/src/main/java/com/bytechef/task/dispatcher/condition/util/ConditionTaskUtils.java
index 56ce7dd36d8..0b5b9d9dc64 100644
--- a/server/libs/modules/task-dispatchers/condition/src/main/java/com/bytechef/task/dispatcher/condition/util/ConditionTaskUtils.java
+++ b/server/libs/modules/task-dispatchers/condition/src/main/java/com/bytechef/task/dispatcher/condition/util/ConditionTaskUtils.java
@@ -24,118 +24,55 @@
import com.bytechef.commons.util.MapUtils;
import com.bytechef.task.dispatcher.condition.constant.ConditionTaskDispatcherConstants;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.springframework.expression.EvaluationContext;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
+import org.springframework.expression.spel.support.SimpleEvaluationContext;
import tools.jackson.core.type.TypeReference;
/**
* Utility class for evaluating condition expressions in workflow condition dispatchers.
*
+ *
+ * Security: Expression evaluation runs against a {@link SimpleEvaluationContext} that disables Java type
+ * references ({@code T(...)}), constructors, and bean references. Method resolution is limited to instance methods via
+ * {@code withInstanceMethods()}, which blocks static methods as well as methods declared on {@link Object},
+ * {@link Class}, and {@link ClassLoader}. This closes the SpEL-injection sink reported in
+ * #5081 that was independent of the
+ * {@code SpelEvaluator} hardening in #5035.
+ *
* @author Matija Petanjek
*/
public class ConditionTaskUtils {
- private static final ExpressionParser expressionParser = new SpelExpressionParser();
-
- /**
- * Resolves the condition case by evaluating the expression from the task execution parameters.
- *
- *
- * Security Note: SpEL expression evaluation is an intentional core feature for workflow condition branching.
- * This component evaluates conditions defined by workflow creators to determine workflow execution paths. The
- * SPEL_INJECTION suppression is appropriate because:
- *
- *
- * - Condition evaluation is the primary purpose of this component
- * - Expressions are constructed from predefined templates with URL-encoded user values
- * - Only specific comparison operations are supported (equals, contains, regex, etc.)
- * - Workflow conditions are authored by trusted users with platform access
- *
- *
- *
- * The REDOS suppression is for the regex pattern matching operations that are part of condition evaluation.
- */
- @SuppressFBWarnings({
- "SPEL_INJECTION", "REDOS"
- })
- public static boolean resolveCase(TaskExecution conditionTaskExecution) {
- Boolean result;
-
- if (MapUtils.getBoolean(conditionTaskExecution.getParameters(), RAW_EXPRESSION, false)) {
- result = expressionParser
- .parseExpression(MapUtils.getString(conditionTaskExecution.getParameters(), EXPRESSION))
- .getValue(Boolean.class);
- } else {
- List>> conditions = MapUtils.getList(
- conditionTaskExecution.getParameters(), ConditionTaskDispatcherConstants.CONDITIONS,
- new TypeReference<>() {}, Collections.emptyList());
-
- List conditionExpressions = new ArrayList<>();
-
- for (List