/

CVE-2026-29870

Severity:

HIGH RISK

(7.6)

Directory Traversal / Path Traversal in agentic-context-engi

CVE-2026-29870

Awaiting Analysis

Vulnerability type

Category:

Directory Traversal / Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Potential Code Execution

Severity:

HIGH RISK

(7.6)

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 directory traversal vulnerability in agentic-context-engine up to version 0.7.1 allows arbitrary file writes through the checkpoint_dir parameter in OfflineACE.run.

Because file paths are not normalized or validated in save_to_file (ace/skillbook.py), an attacker who can influence checkpoint paths may write outside the intended directory and overwrite arbitrary files accessible to the application process.

Affected context

This issue occurs in deployments using the OfflineACE.run workflow where checkpointing is enabled and the checkpoint_dir parameter is influenced by user-controlled or externally sourced input.

The vulnerability is present when save_to_file in ace/skillbook.py constructs file paths by concatenating user-provided segments with a base checkpoint directory without canonicalization, normalization, or confinement checks.

Any environment where the application runs with permissions to write to sensitive locations (e.g., configuration directories, scripts, or service files) is particularly exposed.

Exploit preconditions

  • Attack surface: Interfaces (CLI, API, config files, orchestration layers) that pass checkpoint_dir or related path components into OfflineACE.run.
  • Required access: Ability to supply or modify the checkpoint directory value or any upstream input that is used to construct it.
  • Trigger point: Execution of OfflineACE.run leading to a call to save_to_file, which writes checkpoints based on the unvalidated path.
  • Why exploitation is possible: The code trusts the provided checkpoint path, performing no normalization, traversal filtering, or confinement to a designated root directory, allowing ../ sequences to escape the intended folder and target arbitrary writable paths.

Why this happens

The underlying bug is a classic path traversal issue aligned with CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Instead of treating path segments as untrusted and constraining them to a specific base directory, the implementation directly combines the checkpoint_dir value with filenames and passes the resulting path to filesystem write APIs.

Without normalization (e.g., resolving .. components) and explicit checks that the final resolved path still resides under the intended checkpoint root, attackers can craft traversal sequences that redirect writes to arbitrary locations.

This pattern reflects a broader anti-pattern: constructing filesystem paths from external input without applying canonicalization, allowlisting, or sandbox-style directory enforcement.

Potential impact

  • Overwriting application configuration files, which may alter runtime behavior or disable security controls.
  • Overwriting code files, scripts, or plugins loaded by the application, which could lead to arbitrary code execution on subsequent runs.
  • Corruption of application state or model/checkpoint data, potentially causing denial of service or degraded functionality.
  • Tampering with logs, cache files, or other local artifacts, which may affect observability or incident response.
  • In environments with shared paths or elevated write permissions, potential privilege escalation via modification of startup scripts or service units.

General mitigation guidance

Effective mitigation focuses on treating all path input as untrusted and strictly confining file operations to controlled directories:

  • Normalize and canonicalize paths before use (e.g., using standard library utilities) and verify that the resolved path remains under a designated checkpoint root directory.
  • Avoid directly concatenating user-controlled strings with filesystem paths; instead, use join functions with pre-validated identifiers or generated filenames.
  • Apply a strict allowlist for checkpoint locations (e.g., selecting from predefined directories) rather than accepting arbitrary paths from outside the trust boundary.
  • Run the application with least-privilege filesystem permissions so that, even if a traversal occurs, sensitive system paths and executable locations are not writable.
  • Where feasible, isolate checkpoint storage (e.g., via container volumes or chroot-like mechanisms) to limit the blast radius of any file write operations.

How teams detect issues like this

Organizations can detect and monitor for this class of vulnerability using a combination of code-centric and runtime approaches:

  • Static analysis: Configure rules that flag direct use of user-influenced path strings in file write operations (e.g., open, write, or library wrappers) without preceding normalization and base-path checks.
  • Code review: During manual reviews, pay special attention to functions like save_to_file and any logic that combines external input with filesystem paths, ensuring there is explicit confinement to an expected directory.
  • Policy enforcement: Introduce development guidelines that require all file IO entry points to validate paths against a known-safe root and document this as a mandatory checklist item for features involving persistence.
  • Runtime monitoring: Where possible, use audit logs or OS-level monitoring to detect unexpected write attempts outside designated data directories by the application process, which may reveal exploitation or misuse.
  • Automated security scanning tools and SAST platforms can be configured or tuned to recognize path traversal patterns and highlight them during CI pipelines.

Sources

SourceLink
github.comgithub.com/lilmingwa13/security-research/blob/main/CVE-2026-29870.md

Frequently asked

questions

It can be, depending on how checkpoint_dir is sourced. If remote users can influence configuration, request parameters, or job definitions that set checkpoint_dir, then the issue becomes remotely exploitable. If only local administrators can change it, exploitation is limited to those with local or administrative access.

An attacker needs the ability to control or significantly influence the value passed into OfflineACE.run as the checkpoint directory, either directly via an exposed interface or indirectly via configuration files or orchestration systems that the application trusts.

The safest pattern is to canonicalize all checkpoint paths, enforce that the resolved path resides under a single trusted base directory, and avoid accepting fully arbitrary paths from untrusted sources. Prefer selecting from predefined storage locations or generating internal subpaths rather than using raw user-provided filesystem paths.

Establish a standard path-handling utility that all file operations must go through, which performs normalization and base-directory enforcement, and integrate static analysis rules and code review checklists that specifically call out path construction from external input as a high-risk area. Running services with minimal filesystem permissions further reduces the impact of any residual issues.

Find out what's already
exploitable in your codebase.