Summary
NanoClaw contains a path traversal vulnerability in the send_file functionality, allowing remote requests to influence file path handling. When attacker-controlled path input is accepted without adequate confinement, an attacker may access files outside the intended directory.
Affected context
The issue affects NanoClaw deployments using the send_file functionality in versions up to 2.0.64. Risk is present where the component processes remotely supplied file references without reliably restricting resolved paths to an approved directory or applying equivalent authorization controls.
Exploit preconditions
- Attack surface: The remotely accessible
send_filefunctionality - Required access: Access to invoke the relevant remote interface; authentication requirements depend on deployment configuration
- Trigger point: File path processing performed when a file is requested or transmitted
- Why exploitation is possible: Insufficient path confinement may allow a supplied path to resolve outside the intended file-access directory
Why this happens
The underlying bug is improper limitation of file paths derived from external input. If path components are accepted without canonicalization, containment checks, and authorization, filesystem operations may reach locations outside the intended directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Potential impact
- An attacker may read files outside the intended application directory
- Sensitive configuration, credentials, or source files could be exposed
- The application may disclose information useful for follow-on attacks
- In deployments permitting file writes through related functionality, unintended files could potentially be modified
General mitigation guidance
Mitigation generally focuses on reducing trust in externally supplied paths and enforcing a strict filesystem boundary.
Common defensive patterns include:
- Resolve paths canonically and verify that they remain within an approved base directory
- Prefer server-side file identifiers or allowlisted filenames over client-supplied paths
- Reject traversal syntax, ambiguous encodings, and symlink-based escapes as defense-in-depth
- Apply authorization checks before file access and expose only the minimum required files
- Run the component with least-privilege filesystem permissions and isolate sensitive paths
- Use read-only access where file transmission does not require modification
How teams detect issues like this
Organizations commonly detect path traversal risks through:
- Static analysis for filesystem APIs receiving request parameters or other untrusted path data
- Code review checks for missing canonicalization, containment validation, or authorization
- Dynamic testing with normalized, encoded, and separator-variant path inputs in controlled environments
- Runtime policy controls that alert on access outside approved directories
- Automated security review tools and dependency monitoring that flag known vulnerable components

