Skip to content

Instantly share code, notes, and snippets.

@Ro1ME
Last active September 26, 2026 04:38
Show Gist options
  • Select an option

  • Save Ro1ME/946b670dfefd594a123ed4527de34088 to your computer and use it in GitHub Desktop.

Select an option

Save Ro1ME/946b670dfefd594a123ed4527de34088 to your computer and use it in GitHub Desktop.
CVE-2026-51873 - Directory Traversal in Devika (coder.py:Coder.save_code_to_project)

CVE-2026-51873

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

Description

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.

Reproduction Notes (condensed, sanitized)

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

Discoverer

Ro1ME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment