Type: Directory Traversal
Product: Devika
Affected versions: v1.0
Affected component: src/agents/feature/feature.py:Feature.save_code_to_project
Suggested CWE: CWE-22 (Directory Traversal)
Reference: stitionai/devika#707
In Devika v1.0, the Feature Agent save_code_to_project function contains a path traversal vulnerability that allows attackers to write files outside the intended project workspace, potentially compromising the entire server.
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 boundary
- Path traversal with ../../ segments succeeds without validation
- Disguised relative path (notes/../../) bypasses LLM safety checks ROOT CAUSE:
- Source: src/agents/feature/feature.py:64 (Feature.save_code_to_project) - Accepts LLM-generated path without validation
- No normalization or boundary checks after path join SECURITY IMPACT:
- Directory traversal allows writing outside project workspace
- Attacker can manipulate LLM to generate malicious paths via feature requests
- Potential for arbitrary file write on filesystem REVIEWER NOTE: …
Ro1ME