Back to skill

Security audit

Local File Manager

Security checks for vulnerabilities and agentic risk

Overview

This file manager claims to stay inside the working directory, but its implementation can run unsafe shell commands and has filesystem effects outside that boundary.

Treat this as needing review before installation. Only use it in a disposable, tightly sandboxed environment, and prefer a version that uses native filesystem APIs or execFile/spawn with argument arrays, resolves packaged scripts relative to the installed module, canonicalizes paths against cwd, blocks symlink escapes, enforces size limits, and makes logging opt-in or workspace-local.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
index.ts:20
Finding

Arbitrary Command Execution Through Shell Argument Injection

Content
View full analysis
compromised.txt #" } ``` 2. The skill constructs a command resembling: ```bash CWD="..." "/Users/nico/.openclaw/workspace/skills/loca ...[truncated 891 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/file_manager.sh:63
Finding

Working-Directory Sandbox Escape Through Symbolic Links

Content
View full analysis
&2 exit 1 fi echo "$p" } ``` The resulting path is subsequently used by operations that follow symbolic links: ```bash read) [[ -z "$PATH" ]] && { echo "Error: --path required for read" >&2; exit 1; } FILE="$(resolve_path "$PATH")" if [[ ! -f "$FILE" ]]; then echo "Error: File not found: $FILE" >&2 exit 1 fi if [[ $DRY_RUN -eq 1 ]]; then echo "[DRY-RUN] Would read: $FILE" exit 0 fi cat "$FILE" log "READ $FILE" ;; write) [[ -z "$PATH" ]] && { echo "Error: --path required for write" >&2; exit 1; } FILE="$(resolve_path "$PATH")" if [[ -z "$CONTENT" ]]; then # Read from stdin CONTENT=$(cat) fi if [[ $DRY_RUN -eq 1 ]]; then echo "[DRY-RUN] Would write to: $FILE ($(echo -n "$CONTENT" | wc -c) bytes)" exit 0 fi mkdir -p "$(dirname "$FILE")" printf "%s" "$CONTENT" > "$FILE" log "WRITE $FILE ($(echo -n "$CONTENT" | wc -c) bytes)" ;; ``` ### Technical Analysis The `resolve_path` function performs only lexical filtering. It removes one leading slash and rejects any input containing the substring `..`, but it does not resolve the path to its canonical filesystem target. Filesystem operations such as `cat`, output redirection, `find`, and `rm` may follow symbolic links. A relative path that appears to remain under cwd can therefore resolve to a file or directory elsewhere on the filesystem. A symlinked directory can also redirect nested paths outside cwd. This violates the documented security claim that all ...[truncated 1207 chars]
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Error
Location
index.ts:34
Finding

Execution of an External Hard-Coded Script Instead of the Audited Package Script

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/file_manager.sh:93
Finding

Declared File-Size Limit Is Not Enforced

Content
View full analysis
&2; exit 1; } FILE="$(resolve_path "$PATH")" if [[ -z "$CONTENT" ]]; then # Read from stdin CONTENT=$(cat) fi if [[ $DRY_RUN -eq 1 ]]; then echo "[DRY-RUN] Would write to: $FILE ($(echo -n "$CONTENT" | wc -c) bytes)" exit 0 fi mkdir -p "$(dirname "$FILE")" printf "%s" "$CONTENT" > "$FILE" log "WRITE $FILE ($(echo -n "$CONTENT" | wc -c) bytes)" ;; append) [[ -z "$PATH" ]] && { echo "Error: --path required for append" >&2; exit 1; } FILE="$(resolve_path "$PATH")" if [[ -z "$CONTENT" ]]; then CONTENT=$(cat) fi if [[ $DRY_RUN -eq 1 ]]; then echo "[DRY-RUN] Would append to: $FILE" exit 0 fi mkdir -p "$(dirname "$FILE")" printf "%s\n" "$CONTENT" >> "$FILE" log "APPEND $FILE" ;; ``` ### Technical Analysis Neither the configured `max_file_size` value nor the documented `FILE_MANAGER_MAX_SIZE` environment variable is read or enforced by the script. When content is supplied through stdin, `CONTENT=$(cat)` buffers the entire input in a shell variable before writing it. An attacker can therefore submit content substantially larger than the stated 10 MB limit. Repeated append operations can also grow an existing file without restriction. ### Attack Path 1. The attacker invokes `write` or `append` with a large content value or a large stdin stream. 2. The script reads the input ...[truncated 666 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to be a cwd-local file manager, but it also documents directory creation, deletion, and out-of-cwd logging to ~/.openclaw/logs/file-manager.log. That inconsistency undermines the stated trust boundary and can lead users to expose or modify data outside the expected workspace.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to be a cwd-local file manager, but it also documents directory creation, deletion, and out-of-cwd logging to ~/.openclaw/logs/file-manager.log. That inconsistency undermines the stated trust boundary and can lead users to expose or modify data outside the expected workspace.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest promises operations in the session working directory, but the documentation includes writing logs and example outputs outside cwd. A manifest-to-behavior mismatch weakens security assumptions and can cause roles to enable the skill under false premises.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The safety section says the tool is sandboxed to cwd, yet later examples and configuration reference absolute or home-directory paths outside that boundary. Contradictory safety guidance is dangerous because users and downstream agents may rely on the sandbox claim when the documented behavior suggests broader file access is possible.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation frames the skill as safe and cwd-confined, but the implementation constructs a shell command with interpolated inputs and delegates enforcement to an external script. In this context, the mismatch is dangerous because users and calling agents may trust the safety claim while the code path enables shell injection and possible escape from the intended working-directory boundary.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill claims to provide safe local file I/O in the working directory, but it actually delegates core operations to a shell script using child_process.exec. That expands the attack surface substantially because shell execution introduces command injection risk and makes the actual enforcement of cwd restrictions opaque and unverifiable from this file.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

A local file manager does not need general shell execution, yet this file imports and uses exec to run a command string. Using a shell for file operations is dangerous because untrusted fields like path, dir, content, and pattern are concatenated into the command line, enabling injection or unintended command behavior if special characters are supplied.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description says to use the skill whenever you need to persist output to disk, read input files, or manipulate the file system safely, which is a very broad natural-language activation scope. It does not provide explicit trigger phrases, exclusions, or negative examples to distinguish when this skill should or should not be invoked.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language guidance conflicts with itself by asserting cwd-only safety while examples and log paths imply broader filesystem interaction. Inconsistent guidance is risky because agents may choose permissive interpretations and perform operations users did not expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The capabilities list includes overwrite, delete, and move-like operations without prominent destructive-operation warnings. This is dangerous in an agent setting because users or downstream prompts may invoke data-loss actions without understanding that files can be overwritten or removed.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

The skill explicitly enables persistence via write/append/delete operations, which creates lasting state in the session environment. While persistence is part of the intended function, it is still security-relevant because it can retain sensitive data, alter later agent behavior, or destroy previous artifacts if misused.

Content

Scanner excerpt · SKILL.md (reported line 13)May include surrounding context.

md
## Capabilities

- **Read file**: Get contents of a text file
- **Write file**: Create or overwrite a file
- **Append file**: Add content to existing file
- **List files**: Directory listing with filtering
- **Delete file**: Remove a file (with safety checks)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest description says the skill can read, write, append, and list local files. The declared commands also include file-mkdir and file-delete, which are additional destructive or scope-expanding capabilities not described in the manifest.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill invokes an external shell script via child_process.exec, which is a safety-relevant operation. Although the header mentions file I/O generally, this file provides no user-facing confirmation, logging, or explicit warning that shell execution occurs when the skill runs.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documented capability boundary says the skill is for reading, writing, appending, and listing files in the working directory, but the implementation also supports mkdir and delete. This kind of capability mismatch is dangerous because agents or users may invoke the skill under false assumptions, enabling destructive operations that were not disclosed or expected.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The log function writes to ${FILE_MANAGER_LOG:-$HOME/.openclaw/logs/file-manager.log}, which is outside the declared working-directory scope of the skill. This creates an undeclared side effect and can persist file names and operation history in a broader filesystem location than users or orchestrators expect.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

Writing logs to $HOME violates the stated purpose of safely managing files only within the session working directory and may leave persistent traces across sessions. In multi-tenant or sensitive environments, these logs can disclose filenames, activity timing, and data-handling patterns outside the intended containment boundary.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a broader capability set than the user-facing skill metadata promises, including directory traversal, search, move, and delete. This mismatch can mislead users or higher-level policy checks into granting a skill more destructive authority than expected, especially because delete permission is explicitly declared for the workspace.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description is written entirely in Chinese and does not indicate that language is configurable, optional, or limited to a justified region-specific use case. This can violate language/locale policy when a skill implicitly forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill documents logging to a home-directory path but does not clearly warn that file names, paths, or operation metadata may be persisted outside the workspace. This creates a privacy and data-governance risk, especially if sensitive filenames or content-related metadata are logged.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
68% confidence
Finding

The natural-language trigger list includes several Chinese terms alongside English phrases, but the skill does not document any language-selection behavior or explain the locale policy. This can create an implicit language/locale constraint without clear user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The scripts section advertises a search capability that is not disclosed in the stated skill purpose. While search is less destructive than delete, undisclosed file discovery can expose sensitive filenames or contents within the allowed workspace and indicates the manifest is not faithfully representing behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.