/

CVE-2026-32232

Severity:

CRITICAL RISK

(9.8)

Path Traversal and Insecure File Handling in ZeptoClaw

CVE-2026-32232

Analyzed

Vulnerability type

Category:

Path Traversal and Insecure File Handling

CWE:

CWE-22, CWE-62

Impact:

Arbitrary File Access and Modification

Severity:

CRITICAL RISK

(9.8)

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

ZeptoClaw, a personal AI assistant, contained a critical file-system vulnerability where dangling symlinks, TOCTOU races between validation and use, and hardlink aliases could be abused to bypass path restrictions.

Under certain conditions, an attacker with local access could trick the application into reading, writing, or modifying files outside the intended directories, leading to severe compromise of confidentiality, integrity, or availability.

Affected context

The vulnerability affects ZeptoClaw deployments where the assistant interacts with the local filesystem, such as reading, writing, or managing user files on disk.

It is most relevant when:

  • The application attempts to confine file operations to specific directories or paths
  • Files are accessed based on user-supplied or dynamically constructed paths
  • The runtime environment allows creation of symbolic links or hardlinks pointing to sensitive locations

In such setups, link-based and race-condition-based bypasses can undermine directory and path checks that are intended to enforce security boundaries.

Exploit preconditions

  • Attack surface: Local filesystem operations performed by ZeptoClaw (e.g., file reads/writes, imports, log handling, or data storage).
  • Required access: Ability to create or modify files, directories, symlinks, or hardlinks in locations ZeptoClaw interacts with. This may be via a local user account, a container volume, or another process sharing the same filesystem.
  • Trigger point: Any operation where ZeptoClaw:
  • Validates a file path or checks that it resides in an allowed directory, and
  • Later opens or modifies that path, potentially after an attacker-controlled change (TOCTOU window).
  • Why exploitation is possible:
  • Dangling symlink component bypass: Path validation occurs on components that can later resolve to a different target when the symlink is created or repointed.
  • TOCTOU between validation and use: There is a time gap between checking that a path is safe and performing the file operation; the attacker can alter the path or link in between.
  • Hardlink alias bypass: Security checks are applied to one path, but a hardlink alias pointing to another file (potentially sensitive) is used during the actual operation.

Why this happens

The core issue lies in trusting pathname validation and directory constraints without accounting for the mutable nature of filesystem links and race conditions.

This maps primarily to:

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'): The application attempts to restrict file operations to certain directories, but does not robustly enforce these constraints when symbolic links, hardlinks, or path manipulation are involved.
  • CWE-62: Unrealized Access Control via Link-Following: The application follows filesystem links without verifying that the final resolved target remains within a safe, intended location.

Security checks are performed on the string representation of a path or an initial filesystem state, rather than on the fully resolved, canonical path at the moment of use.

Coupled with a TOCTOU pattern (checking, then using later), this allows attackers to swap in malicious link targets after validation, causing ZeptoClaw to operate on files outside its intended trust boundary.

Potential impact

  • Access to files outside the designated working directories, which may include configuration data or other sensitive application files.
  • Overwriting or corrupting arbitrary files writable by the ZeptoClaw process, potentially leading to data loss or persistent compromise.
  • Escalation of privileges in environments where ZeptoClaw runs with higher permissions than the attacker (e.g., a user service with broader filesystem access).
  • Indirect remote impact if ZeptoClaw is exposed via network APIs and backs user actions with local file operations that can be influenced by an attacker-controlled environment.
  • Disruption of application behavior through manipulation or deletion of critical files (denial of service).

General mitigation guidance

Effective mitigation focuses on enforcing robust, link-safe file access patterns and minimizing TOCTOU windows.

General defensive strategies include:

  • Use canonical, link-resolved paths for enforcement:
  • Resolve all paths to their absolute, canonical form (following symlinks) immediately before access.
  • Enforce that the canonical path resides within an allowed directory (e.g., comparing against a canonical root).
  • Avoid TOCTOU between check and use:
  • Combine validation and opening into a single atomic operation where possible (e.g., using OS-level flags and directory file descriptors).
  • Re-validate the resolved file descriptor or path right after opening, not just the string path beforehand.
  • Constrain link behavior:
  • Where feasible, operate in directories mounted with restricted link semantics (e.g., disabling unprivileged hardlinks, using nosymfollow or equivalent filesystem options when available).
  • Treat any path segment that is a symbolic link as untrusted unless explicitly intended and validated.
  • Apply least-privilege file access:
  • Run ZeptoClaw under an account that has only the minimal filesystem permissions needed.
  • Isolate application data into dedicated directories and avoid using global or shared paths for sensitive files.
  • Treat user-controllable paths as untrusted:
  • Avoid using raw user input to construct file paths.
  • If user-provided locations must be supported, gate them behind clearly defined, validated base directories and strict path normalization routines.

These patterns help ensure that even if an attacker can create links or manipulate the filesystem, they cannot easily redirect file operations to unintended targets.

How teams detect issues like this

Detecting this class of vulnerability typically involves a mix of static analysis, code review, and runtime hardening:

  • Static analysis and linting:
  • Flag uses of generic file APIs that rely on string-based path checks (e.g., naive startswith or substring checks) to enforce directory boundaries.
  • Identify patterns where os.path validation is followed by separate open/read/write calls without ensuring atomicity or canonicalization.
  • Highlight any reliance on temporary directories, user-controlled paths, or shared working directories without stricter link protections.
  • Code review focus areas:
  • Examine all file access logic that claims to restrict access to a "safe" or "sandboxed" directory.
  • Look for absence of canonical path checks or for checks performed only on the initial path rather than the resolved target.
  • Review how the application handles symlinks and hardlinks, especially in areas where users can influence directory contents.
  • Policy and runtime controls:
  • Use mandatory access control frameworks (e.g., SELinux, AppArmor, or container security profiles) to constrain which directories the process can access, independent of application logic.
  • Monitor for creation and use of links in application-managed directories that are not expected to contain them.
  • Automated tooling:
  • Incorporate SAST tools that support detection of path traversal and link-following issues.
  • Utilize filesystem monitoring or sandboxing during testing to detect access attempts outside of designated directories.

Sources

SourceLink
github.comgithub.com/qhkm/zeptoclaw/commit/f50c17e11ae3e2d40c96730abac41974ef2ee2a8
github.comgithub.com/qhkm/zeptoclaw/security/advisories/GHSA-2m67-cxxq-c3h8

Frequently asked

questions

Exploitability depends on who can influence the filesystem paths ZeptoClaw uses. In environments where an untrusted or less-privileged user can create files, symlinks, or hardlinks in directories the assistant accesses, the issue can often be exploited reliably. In more locked-down deployments, practical exploitability may be reduced but not entirely eliminated.

Not necessarily. The attacker generally needs the ability to manipulate files, directories, or links in specific locations that ZeptoClaw reads from or writes to. This might be a regular local user account, a process running in the same container, or any mechanism that lets them control parts of the filesystem visible to the application.

The safest pattern is to resolve and validate canonical paths right before use, perform access checks against a known-safe root directory, and use OS-level primitives that minimize TOCTOU windows (such as directory file descriptors and flags that limit link-following). Additionally, keep the process running with minimal filesystem privileges and avoid sharing its working directories with less-trusted actors.

Prevention relies on designing file access paths as explicit trust boundaries. Treat any user-influenced path as untrusted, avoid relying on string comparisons to enforce directory constraints, standardize on canonical path resolution utilities, and integrate checks for path traversal and link-following issues into code review and automated security testing. Where possible, reinforce application logic with OS-level sandboxing to limit the impact of any remaining issues.

Find out what's already
exploitable in your codebase.