/

CVE-2026-51875

Severity:

CRITICAL RISK

(9.1)

Path Traversal (CWE-22) in Devika Feature Agent Code

CVE-2026-51875

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File Write and Potential Server Compromise

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical path traversal vulnerability in Devika v1.0 allows attackers to make the Feature Agent write files outside the intended project workspace. If the affected function can be reached with attacker-controlled file paths, this may enable server compromise through unauthorized file modification.

A critical path traversal vulnerability in Devika v1.0 allows attackers to make the Feature Agent write files outside the intended project workspace. If the affected function can be reached with attacker-controlled file paths, this may enable server compromise through unauthorized file modification.

Affected context

The vulnerability occurs in Devika v1.0 within the Feature Agent's save_code_to_project function. It becomes risky when file paths supplied to the function are not reliably confined to the designated project workspace and an attacker can influence the save operation.

The vulnerability occurs in Devika v1.0 within the Feature Agent's save_code_to_project function. It becomes risky when file paths supplied to the function are not reliably confined to the designated project workspace and an attacker can influence the save operation.

Exploit preconditions

  • Attack surface: The Feature Agent code-saving functionality
  • Required access: Access sufficient to invoke the affected function or submit data processed by it
  • Trigger point: File creation or modification through save_code_to_project
  • Why exploitation is possible: User-controlled path components may be resolved outside the intended workspace when canonicalization and boundary checks are insufficient
  • Attack surface: The Feature Agent code-saving functionality
  • Required access: Access sufficient to invoke the affected function or submit data processed by it
  • Trigger point: File creation or modification through save_code_to_project
  • Why exploitation is possible: User-controlled path components may be resolved outside the intended workspace when canonicalization and boundary checks are insufficient

Why this happens

The underlying bug is improper restriction of user-influenced file paths. A path is accepted for file writing without ensuring that its normalized destination remains within the approved project directory. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

The underlying bug is improper restriction of user-influenced file paths. A path is accepted for file writing without ensuring that its normalized destination remains within the approved project directory. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

Potential impact

  • An attacker may overwrite or create files outside the project workspace
  • Application configuration or source files could be modified
  • Server-side code execution could occur if a writable file is later loaded or executed
  • Credentials, data, or service availability could be compromised
  • The affected server could be used for further lateral movement
  • An attacker may overwrite or create files outside the project workspace
  • Application configuration or source files could be modified
  • Server-side code execution could occur if a writable file is later loaded or executed
  • Credentials, data, or service availability could be compromised
  • The affected server could be used for further lateral movement

General mitigation guidance

Mitigation generally focuses on reducing trust in supplied paths and enforcing a clear filesystem boundary.

Common defensive patterns include:

  • Resolve and canonicalize candidate paths before writing
  • Verify that the resulting path remains beneath the intended workspace
  • Prefer generated filenames or validated relative paths over arbitrary filesystem paths
  • Reject absolute paths, traversal components, and ambiguous path encodings
  • Use allowlisted file types and tightly scoped writable directories
  • Run the service with least-privilege filesystem permissions
  • Apply filesystem isolation and read-only controls where practical

Mitigation generally focuses on reducing trust in supplied paths and enforcing a clear filesystem boundary.

Common defensive patterns include:

  • Resolve and canonicalize candidate paths before writing
  • Verify that the resulting path remains beneath the intended workspace
  • Prefer generated filenames or validated relative paths over arbitrary filesystem paths
  • Reject absolute paths, traversal components, and ambiguous path encodings
  • Use allowlisted file types and tightly scoped writable directories
  • Run the service with least-privilege filesystem permissions
  • Apply filesystem isolation and read-only controls where practical

How teams detect issues like this

Organizations can look for path traversal risks through:

  • Static analysis rules targeting file APIs that receive user-controlled paths
  • Code review checks for missing canonicalization and workspace-boundary validation
  • Tests covering absolute paths, traversal sequences, symbolic links, and encoding variations
  • Runtime monitoring for writes outside approved application directories
  • Policy enforcement that restricts service write permissions to dedicated directories

Neutral automated review tools may help identify unvalidated path construction during development.

Organizations can look for path traversal risks through:

  • Static analysis rules targeting file APIs that receive user-controlled paths
  • Code review checks for missing canonicalization and workspace-boundary validation
  • Tests covering absolute paths, traversal sequences, symbolic links, and encoding variations
  • Runtime monitoring for writes outside approved application directories
  • Policy enforcement that restricts service write permissions to dedicated directories

Neutral automated review tools may help identify unvalidated path construction during development.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/f667dcf8c3f4852900fa7811944f0f3f
github.comgithub.com/stitionai/devika/issues/708

Frequently asked

questions

Exploitability depends on how the Feature Agent is exposed. It may be remotely exploitable when an attacker can invoke the affected functionality or influence its file path input.

The attacker needs access to a request, agent workflow, or other input path that reaches save_code_to_project. The exact requirement depends on Devika's deployment and authorization controls.

Resolve the requested path, enforce that it remains within a dedicated workspace, reject unsafe path forms, and limit the service's filesystem permissions.

Treat all externally influenced paths as untrusted, use allowlists and canonical boundary checks, test filesystem edge cases, and monitor writes outside approved directories.

Exploitability depends on how the Feature Agent is exposed. It may be remotely exploitable when an attacker can invoke the affected functionality or influence its file path input.

The attacker needs access to a request, agent workflow, or other input path that reaches save_code_to_project. The exact requirement depends on Devika's deployment and authorization controls.

Resolve the requested path, enforce that it remains within a dedicated workspace, reject unsafe path forms, and limit the service's filesystem permissions.

Treat all externally influenced paths as untrusted, use allowlists and canonical boundary checks, test filesystem edge cases, and monitor writes outside approved directories.

Find out what's already
exploitable in your codebase.