Severity:

HIGH RISK

(8.8)

Path Traversal / Filesystem Boundary Violation

CVE-2026-7875

Analyzed

Vulnerability type

Category:

Path Traversal / Filesystem Boundary Violation

CWE:

CWE-22

Impact:

Arbitrary File Read and Potential Recursive Deletion Outside the Intended Directory

Severity:

HIGH RISK

(8.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

NanoClaw exposes a filesystem boundary weakness in its outbound attachment handling and outbox cleanup logic, allowing crafted outbox entries or symlinked files to escape the intended directory sandbox.

A compromised or prompt-injected container can abuse messages_out identifiers and attachment metadata to cause the host to read arbitrary files or, in some cases, recursively delete paths outside the designated outbox directory.

Affected context

This vulnerability appears in environments where NanoClaw mediates file exchange between containers and the host via an "outbox" directory.

It becomes relevant when:

  • Containers can influence messages_out.id and content.files values for outbound attachments.
  • The host relies on these values to locate files without robust path normalization and boundary checks.
  • Outbox files or directories may be symlinked or otherwise indirectly reference other parts of the host filesystem.

Under these conditions, a compromised or prompt-injected container can manipulate outbox entries so that host-side processing crosses the intended host/container filesystem boundary.

Exploit preconditions

  • Attack surface: Host-side NanoClaw processes that handle outbound messages and perform outbox cleanup.
  • Required access: Ability from within a container to:
  • Set or influence messages_out.id and content.files fields for outbound attachments, and/or
  • Create or modify files and symlinks in the container-visible outbox directory.
  • Trigger point: Host execution of:
  • Outbound attachment handling routines that read files based on user-controlled identifiers or paths, and/or
  • Outbox cleanup logic that recursively deletes directories derived from those identifiers.
  • Why exploitation is possible: The host trusts path components derived from container-controlled metadata and filesystem entries, does not consistently normalize or canonicalize paths, and does not enforce that resolved paths remain under the intended outbox root, allowing traversal and symlink escape.

Why this happens

The underlying issue is a classic path traversal and directory boundary enforcement failure, as covered by CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Host-side NanoClaw logic uses container-supplied values such as messages_out.id and content.files to construct or resolve filesystem paths for reading attachments and cleaning up outbox content.

Without robust checks (e.g., resolving to an absolute canonical path, rejecting traversal components, and preventing symlink escape), the implementation allows an attacker-controlled container to direct file operations to locations outside the designated outbox directory.

Additionally, cleanup routines that recursively delete directories based on these same, insufficiently validated paths can be coerced into deleting unintended paths, extending the impact from read access to potential destructive operations.

Potential impact

  • Host-side reads of arbitrary files accessible to the NanoClaw process, including configuration files, credentials, or other sensitive data.
  • Leakage of host secrets back into the compromised container through normal NanoClaw message channels.
  • Recursive deletion of directories outside the intended outbox root, which could:
  • Remove application data or logs.
  • Disrupt service availability.
  • Interfere with security controls or monitoring artifacts.
  • Expanded attack surface for lateral movement if sensitive host data is exfiltrated and reused.
  • Degradation of isolation guarantees between containers and the host, undermining multi-tenant safety assumptions.

General mitigation guidance

Effective mitigation focuses on strict enforcement of directory boundaries, path hygiene, and least privilege for file operations.

Pattern-based defensive measures include:

  • Canonical path enforcement:
  • Resolve all file and directory paths to their absolute, canonical form (e.g., using realpath-like semantics) before use.
  • Confirm that the resolved path is strictly within the intended outbox root directory before performing any read or delete operations.
  • Input normalization and validation:
  • Treat messages_out.id, content.files, and similar fields as untrusted input.
  • Reject or sanitize values containing traversal indicators (e.g., .., absolute paths, or embedded path separators) rather than attempting to "fix" them silently.
  • Symlink-aware controls:
  • Avoid following symlinks when operating within the outbox directory where possible.
  • When symlinks must be supported, enforce checks on the resolved target to ensure it remains under the expected root; otherwise, fail the operation.
  • Separation of identifiers from paths:
  • Use opaque, server-generated identifiers for directory and file names instead of allowing containers to supply full or partial paths.
  • Maintain a host-side mapping from identifiers to sanitized filesystem locations.
  • Constrained cleanup routines:
  • Implement cleanup logic that limits deletion to pre-defined, host-controlled directories derived from trusted configuration rather than dynamic, container-supplied values.
  • Prefer whitelisting specific directories or patterns for deletion rather than constructing paths directly from container data.
  • Least-privilege file permissions:
  • Run NanoClaw host components with restricted filesystem privileges, ensuring they cannot read or delete sensitive host directories even if a path escape is attempted.
  • Use OS-level controls (such as chroot jails, mount namespaces, or bind mounts) to further constrain accessible paths.

How teams detect issues like this

Detection and assurance can be improved by combining static analysis, code review, and runtime monitoring aimed at path handling logic.

Possible approaches include:

  • Static analysis patterns:
  • Flag uses of file APIs (open, read, delete, recursive directory operations) where any part of the path is derived from container-controlled fields like messages_out.id or content.files.
  • Identify path concatenations that do not pass through canonicalization and boundary checks.
  • Highlight code that follows symlinks within directories intended to act as isolation boundaries.
  • Code review signals:
  • Explicitly review all modules responsible for outbox handling and cleanup, looking for assumptions about the trustworthiness of container-supplied identifiers.
  • Require documented invariants stating that all file operations must be confined to a specific root, and verify that these invariants are enforced programmatically.
  • Check for reuse of helper functions that enforce canonicalization and boundary checks, rather than ad-hoc path manipulation scattered throughout the codebase.
  • Policy and tooling:
  • Introduce secure coding guidelines that mandate canonicalization and boundary verification for any path constructed from untrusted input.
  • Integrate automated review tools and linters configured to detect path traversal patterns and risky cleanup logic as part of CI/CD.
  • Runtime monitoring:
  • Monitor host-side NanoClaw processes for access to directories outside the configured outbox path, using file integrity monitoring or audit logs.
  • Set alerts for unexpected deletions or reads in sensitive directories that could indicate exploitation attempts.

Sources

SourceLink
github.comgithub.com/qwibitai/nanoclaw/commit/7814e45570edf0024a1a5c2ba9fbc9cb3a49f7f7
github.comgithub.com/qwibitai/nanoclaw/pull/2001
github.comgithub.com/qwibitai/nanoclaw/releases/tag/v1.2.0

Frequently asked

questions

Exploitability is scoped to environments where containers can influence outbound message identifiers and outbox contents, and where the host uses those values to drive file operations without strong boundary checks. In such setups, any compromised or prompt-injected container could attempt to exploit the weakness, but the actual impact depends on the host's filesystem layout and OS-level protections.

The attacker needs control over a container that can interact with NanoClaw's outbox mechanism. This typically means being able to craft or modify messages_out.id, content.files, or outbox files (including symlinks) from within the container. No additional host-level privileges are required beyond whatever the NanoClaw host process already possesses.

The most robust fix pattern is to decouple container-provided data from direct filesystem paths: treat container metadata as opaque identifiers, map them to host-generated paths, and enforce canonical path checks that ensure all resolved paths stay under a configured root. Combine this with symlink-safe file operations and tightly constrained cleanup routines that operate only on trusted, pre-defined directories.

Prevention hinges on designing file-handling code with explicit trust boundaries and invariants. Adopt development practices that: require canonicalization and boundary checks for any path derived from untrusted input; prohibit arbitrary symlink following in shared directories; enforce least privilege for host processes; and embed these rules into code review checklists, secure coding guidelines, and automated static analysis configurations so that new path traversal bugs are caught early.

Find out what's already
exploitable in your codebase.