# CVE-2026-51875: Devika path traversal in save_code_to_project function

Source: https://junglewise.ai/threats/cve-2026-51875-in-devika-v1-0-the-feature-agent-save-code-to-project-function  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-01. Updated: 2026-10-05  
License: CC BY 4.0 with a link back

CVE-2026-51875 · Severity: info · Published 2026-10-01

Devika is an AI-powered code generation tool that accepts user requests to create and modify project files. A path traversal vulnerability in the save_code_to_project function allows attackers to write files outside the project workspace by injecting relative path sequences (like ../../), potentially enabling arbitrary file writes, code execution, or data theft on the server.

Technologies: [Stitionai Devika](https://junglewise.ai/threats/technologies/devika). Vendors: [Stitionai](https://junglewise.ai/threats/vendors/stitionai).

## Quick answers

**Is CVE-2026-51875 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-51875 being exploited in the wild.

**How severe is CVE-2026-51875?** Informational severity, published 1 October 2026.

**Which products and versions are affected?** Stitionai Devika v1.0.

**Is there a fix for CVE-2026-51875?** No fixed version is recorded yet. Normalize all file paths using os.path.normpath() or pathlib.Path.resolve() and verify that the resolved path remains within the project workspace before writing; reject or sanitize paths containing .. sequences or absolute paths. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-51875 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-51875?** Check whether you run Stitionai Devika at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix


Normalize all file paths using os.path.normpath() or pathlib.Path.resolve() and verify that the resolved path remains within the project workspace before writing; reject or sanitize paths containing .. sequences or absolute paths.

## Technical details

The vulnerability exists in src/agents/feature/feature.py where the save_code_to_project function constructs file paths using os.path.join() without validating or normalizing user-controlled or LLM-generated file names. An attacker can embed directory traversal sequences (../) in feature requests to escape the intended project workspace and write to arbitrary filesystem locations. The attack is triggered via Socket.IO user-message events with action=feature, allowing remote exploitation without authentication barriers.

## Affected products

- stitionai Devika v1.0

## Timeline

- 2026-04-20: disclosed
- 2026-10-01: advisory

## References

- [https://gist.github.com/Ro1ME/f667dcf8c3f4852900fa7811944f0f3f](https://gist.github.com/Ro1ME/f667dcf8c3f4852900fa7811944f0f3f)
- [https://github.com/stitionai/devika/issues/708](https://github.com/stitionai/devika/issues/708)

## Related threats

- [Devika directory traversal in Coder.save_code_to_project](https://junglewise.ai/threats/cve-2026-51873-devika-v1-0-is-vulnerable-to-directory-traversal-in-the-coder)
- [Devika code injection in Runner.execute function](https://junglewise.ai/threats/cve-2026-51871-devika-v1-0-is-vulnerable-to-code-injection-in-the-runner-execute)
