#519 [API/Memory] Workflow graph generation - unbounded recursion
Description
Edit**File:** api/blueprints/v1/workflows.py:1283-1307, 1488-1526
**Problem:** Deeply nested workflows (parallel within loops within parallel) cause exponential dict growth. No recursion depth limit. Malicious/malformed workflows can trigger OOM.
**Fix:**
```python
MAX_TASK_COUNT = 10000
MAX_RECURSION_DEPTH = 50
def _extract_all_tasks(tasks_dict, parent_prefix="", depth=0):
if depth > MAX_RECURSION_DEPTH:
raise ValueError("Workflow nesting too deep")
if len(all_tasks) > MAX_TASK_COUNT:
raise ValueError("Too many tasks in workflow")
```
**Impact:** OOM on malicious workflow submissions.
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...