Type: Directory Traversal
Product: Devika
Affected versions: v1.0
Affected component: src/agents/coder/coder.py:Coder.save_code_to_project
Suggested CWE: CWE-22 (Directory Traversal)
Reference: stitionai/devika#707
Devika v1.0 is vulnerable to Directory Traversal in the Coder.save_code_to_project function, which allows attackers to write files outside the intended project workspace.
Condensed from the authorized local validation used for the original report; local filesystem paths are replaced with <local-path>.
EXPECTED RESULT: - File created outside intended project workspace
- Path traversal succeeds without validation
- LLM preserves literal path including ../../ sequences ROOT CAUSE:
- Source: src/agents/coder/coder.py:66 (Coder.save_code_to_project)
- Accepts LLM-generated paths without normalization
- No boundary checks after path join
- Model output reaches file write sink directly SECURITY IMPACT:
- Directory traversal via LLM prompt manipulation
- Arbitrary file write outside project workspace
- Cross-project contamination possible REVIEWER NOTE: The prompt explicitly instructs the LLM to preserve the literal path without normalization. This demonstrates that the vulnerability is in the file-write logic, not the LLM's p
Ro1ME