Skip to main content
Vulnerability Database/CVE-2026-51875

CVE-2026-51875: Devika v1.0 Path Traversal Vulnerability

CVE-2026-51875 is a path traversal flaw in Devika v1.0 that enables attackers to write files beyond the project workspace, risking full server compromise. This article covers technical details, impact analysis, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-51875 Overview

CVE-2026-51875 is a path traversal vulnerability [CWE-22] in Devika v1.0, an open-source AI software engineering agent. The flaw resides in the save_code_to_project function within the Feature Agent component. Attackers can supply crafted file paths that escape the intended project workspace and write arbitrary files to any location the Devika process can access. Successful exploitation can compromise the entire server hosting Devika.

Critical Impact

Unauthenticated network attackers can write arbitrary files outside the project directory, enabling remote code execution and full server compromise.

Affected Products

  • Devika v1.0
  • Devika Feature Agent module (save_code_to_project function)
  • Deployments tracked in the project repository at stitionai/devika Issue #708

Discovery Timeline

  • 2026-10-01 - CVE-2026-51875 published to the National Vulnerability Database (NVD)
  • 2026-10-05 - Last updated in NVD database

Technical Details for CVE-2026-51875

Vulnerability Analysis

Devika is an agentic AI developer assistant that generates and persists source code into project workspaces. The save_code_to_project function in the Feature Agent accepts file path components derived from model output and writes files to disk. The function fails to canonicalize or validate those paths against the intended project root. An attacker who can influence agent inputs can trigger writes to arbitrary filesystem locations.

Because the attack vector is network-based and requires no authentication or user interaction, any exposed Devika instance is reachable by remote adversaries. Writing attacker-controlled files to locations such as cron directories, SSH authorized_keys files, or Python site-packages converts the flaw into reliable remote code execution. A proof of concept is published in the GitHub Gist PoC Repository.

Root Cause

The root cause is missing input sanitization on filename and directory parameters passed to save_code_to_project. The function concatenates user-influenced path segments with the workspace base path without rejecting traversal sequences such as ../ or absolute paths. This matches the classic [CWE-22] pattern of improper limitation of a pathname to a restricted directory.

Attack Vector

An attacker interacts with the Devika agent over its network interface and submits a feature or coding request that causes the agent to invoke save_code_to_project with a traversal-laden filename. The crafted path resolves outside the workspace, and the file content is written with the privileges of the Devika process. Follow-up actions include dropping web shells, overwriting application code, or planting persistence files in the operating user's home directory.

No exploit code example is reproduced here. Refer to the GitHub Issue #708 Discussion and the published proof of concept for technical details.

Detection Methods for CVE-2026-51875

Indicators of Compromise

  • File write events originating from the Devika process targeting paths outside the configured project workspace directory.
  • New or modified files in sensitive locations such as ~/.ssh/authorized_keys, /etc/cron.d/, or Python site-packages directories after Devika activity.
  • Agent prompt or request logs containing ../ sequences, absolute paths, or encoded traversal payloads in filename fields.

Detection Strategies

  • Instrument the save_code_to_project code path to log the resolved absolute path of every write and alert when it falls outside the workspace root.
  • Correlate Devika HTTP request logs with filesystem telemetry to identify agent-initiated writes to unexpected directories.
  • Deploy filesystem integrity monitoring on the host running Devika to flag changes to startup, cron, and credential files.

Monitoring Recommendations

  • Forward Devika application logs and host process telemetry to a centralized analytics platform for correlation.
  • Alert on outbound network connections initiated by processes spawned under the Devika service account, which may indicate post-exploitation activity.
  • Baseline normal file-write locations for the Devika process and alert on deviations.

How to Mitigate CVE-2026-51875

Immediate Actions Required

  • Remove Devika v1.0 instances from untrusted networks and place them behind authenticated reverse proxies with strict access controls.
  • Run the Devika service under a dedicated low-privilege user account with no write access to system directories or other users' home directories.
  • Audit the host for files written outside the project workspace since Devika was deployed.

Patch Information

No official vendor patch is referenced in the NVD entry for CVE-2026-51875 at the time of publication. Monitor the stitionai/devika Issue #708 tracker for upstream remediation. Operators who maintain forks should modify save_code_to_project to resolve the final path with os.path.realpath and reject any result that does not start with the workspace root.

Workarounds

  • Patch the save_code_to_project function locally to canonicalize paths and enforce a workspace-root prefix check before writing.
  • Reject filenames containing .., null bytes, backslashes, or absolute path prefixes at the API input layer.
  • Run Devika inside a container or chroot with a read-only root filesystem and a bind-mounted workspace directory as the only writable location.
bash
# Example hardening: run Devika in a container with a restricted writable workspace
docker run --rm \
  --read-only \
  --user 1001:1001 \
  --tmpfs /tmp:rw,size=64m \
  -v /srv/devika/workspace:/app/workspace:rw \
  -p 127.0.0.1:3000:3000 \
  devika:local

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.