conductor-oss / conductor-oss/conductor

Fix ArrayIndexOutOfBoundsException in failureWorkflow parameter parsing

Open
#789 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
32.2k
Forks
1k
Avg merge
2d 5h
Merged PRs (30d)
41

Description

## Bug Description

In `WorkflowExecutorOps.java` (around line 1690), when a workflow's `failureWorkflow` uses parameter substitution (e.g., `$.workflow.paramName`), the code splits by `.` and directly accesses index `[2]` without bounds checking:

```java
if (failureWorkflow.startsWith("$")) {
String[] paramPathComponents = failureWorkflow.split("\\.");
String name = paramPathComponents[2]; // No bounds checking!
failureWorkflow = (String) workflow.getInput().get(name);
}
```

If `failureWorkflow` is misconfigured with fewer than 3 components (e.g., `$.input` or `$`), this throws `ArrayIndexOutOfBoundsException` and causes the workflow termination process to fail.

## Expected Behavior

Validate `paramPathComponents.length >= 3` before accessing the array. Log a warning with the expected format if invalid, and allow the workflow to terminate gracefully (downstream code already handles null via `StringUtils.isBlank()`).

## Affected File

- `core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java`

## Prior Art

Community PR #657 by @mohammaddanishali-bit addressed this with bounds checking and a test case.

Contributor guide

Open the contributing guide

Research direction

Read core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java around line 1690 and inspect the existing workflow-execution tests before reproducing malformed failureWorkflow values such as $.input or $. Done means invalid parameter paths produce the expected warning and workflow termination proceeds without ArrayIndexOutOfBoundsException, with a regression test covering the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.