Skip to content

hardening: cap subprocess timeout to prevent indefinite hangs #50

@bjridicodes

Description

@bjridicodes

Severity

LOW

Description

The subprocess timeout in `claude_code_provider.py` is passed directly from config with no upper bound. A misconfigured or corrupted `config.yaml` could set an arbitrarily large timeout, causing the pipeline to hang indefinitely with no recovery.

Affected file

`providers/llm/claude_code_provider.py:69`
```python
result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
```

Fix

```python
MAX_TIMEOUT = 300 # 5 minutes hard cap
result = subprocess.run(cmd, capture_output=True, text=True, timeout=min(timeout, MAX_TIMEOUT))
```

Files to change

  • `providers/llm/claude_code_provider.py`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority/P3Medium — future improvements

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions