Back to skill

Security audit

Local File Manager 1.0.0

Security checks for vulnerabilities and agentic risk

Overview

This file-management skill mostly matches its stated purpose, but its implementation can run unintended shell commands and uses paths that break the promised workspace boundary.

Review before installing. Only use this skill in a disposable or tightly sandboxed workspace until it replaces shell-string exec with argument-safe execution, resolves the bundled script relative to the package, enforces real cwd containment, and documents or removes home-directory logging and destructive actions.

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:22
Finding

Shell Command Injection Through Unescaped Skill Input

Content
View full analysis
/tmp/file-manager-proof #" } ``` 2. The value is appended to `args` without escaping. 3. `args.join(" ")` produces a command containing: ```bash --action read --path safe.txt; id > /tmp/file-manager-proof # ``` 4. `execAsync` passes this string to ...[truncated 1028 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/file_manager.sh:66
Finding

Working-Directory Sandbox Escape Through Symbolic Links

Content
View full analysis
&2 exit 1 fi echo "$p" } ``` The returned path is subsequently used directly in filesystem operations: ```bash FILE="$(resolve_path "$PATH")" cat "$FILE" FILE="$(resolve_path "$PATH")" mkdir -p "$(dirname "$FILE")" printf "%s" "$CONTENT" > "$FILE" DIR="$(resolve_path "$DIR")" mkdir -p "$DIR" ``` ### Technical Analysis The purported sandbox check performs only two textual transformations: 1. It strips a single leading slash. 2. It rejects any string containing `..`. It does not canonicalize the requested path, resolve symbolic links, compare the final target with the canonical working-directory root, or prevent traversal through symlinked parent directories. Filesystem operations such as `cat`, output redirection, `mkdir`, `find`, and `rm` normally follow symbolic links. Consequently, a relative path can pass `resolve_path` while resolving to a file outside the working directory. The function name and comments suggest path resolution, but no actual resolution or containment check occurs. ### Attack Path 1. A symbolic link exists within the session working directory, either preexisting or created by another process with access to that directory: ```bash ln -s /sensitive/location external ``` 2. The attacker invokes a supported action using a path below that link: ```text external/target.txt ``` 3. The path contains neither a leading slash nor `..`, so `resolve_path` accepts it. 4. The operating system resolves `external` to `/sensitive/location`. 5. A read operation accesses `/sensitive/locati ...[truncated 928 chars]
Remediation
View remediation
&2 exit 1 ;; esac ``` For files that do not yet exist, resolve and verify their parent directory first, then use a safely validated basename. ]]>

T07 · Tool Hijacking and Spoofing

Error
Location
index.ts:35
Finding

Hard-Coded External Script Path Bypasses the Audited Package

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/file_manager.sh:83
Finding

Documented File-Size Limit Is Not Enforced

Content
View full analysis
&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)" ;; 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" ;; ``` The documentation claims a configurable limit: ```md - **Size limit**: Max file size 10MB (configurable) ``` ```md - `FILE_MANAGER_MAX_SIZE`: Max file size in bytes (default 10485760) ``` ### Technical Analysis The Bash implementation never reads or enforces `FILE_MANAGER_MAX_SIZE`. Read operations stream an arbitrarily large file to standard output. Write and append operations can read unbounded standard input into the `CONTENT` shell variable, consuming memory before writing it to disk. Append operations also permit files to grow without any maximum resulting size. The TypeScript `maxBuffer` setting only limits captured ch ...[truncated 1379 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 (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description promises operations in the working directory, yet the documentation includes directory creation, file deletion, and logging to ~/.openclaw/logs/file-manager.log, which touches resources outside cwd. Such understated capability expansion can bypass user expectations and policy controls, especially when a skill is approved based on manifest text rather than full implementation details.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description promises operations in the working directory, yet the documentation includes directory creation, file deletion, and logging to ~/.openclaw/logs/file-manager.log, which touches resources outside cwd. Such understated capability expansion can bypass user expectations and policy controls, especially when a skill is approved based on manifest text rather than full implementation details.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The example appends to /var/log/automation.log using an absolute path, directly contradicting the stated cwd sandbox and demonstrating modification of a system-level location without warning. This is dangerous because examples strongly shape agent behavior, and a copied pattern could lead to unauthorized or sensitive file changes outside the intended workspace.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code claims safe file I/O within cwd, but it constructs a shell command by interpolating unescaped user-controlled arguments like path, dir, content, and pattern into a single exec string. An attacker can inject shell metacharacters through these fields and execute arbitrary commands, potentially reading, modifying, or destroying data or escaping the intended file-management scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill shells out to an external script using child_process.exec, which introduces command execution risk well beyond simple local file management. Because user-controlled values are later concatenated into the shell command, this design materially increases the attack surface and can enable arbitrary command execution in the agent runtime.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill claims operations are limited to the session working directory, but log() writes to ${FILE_MANAGER_LOG:-$HOME/.openclaw/logs/file-manager.log}, which is outside that boundary by default. This breaks the confinement model and can create or modify files in the user's home directory, potentially leaking file names and activity metadata across sessions or into persistent storage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description states the skill works within the session working directory, but the documented behavior includes access outside cwd. This weakens trust in the skill’s declared boundary and can cause inappropriate auto-selection or authorization under an overly narrow security assumption.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description is broad enough to match many ordinary requests involving files, which increases the chance of over-invocation for tasks that do not require write, delete, or directory manipulation privileges. In an agent ecosystem, vague trigger language can expand the operational footprint of a powerful skill and raise the risk of unintended file modification or data exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The capability list advertises write, append, delete, and copy/move functionality without clearly warning that these actions can overwrite, alter, or remove user data. Missing warnings lower operator caution and make accidental destructive use more likely, particularly when the skill is presented as 'safe' by default.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
87% confidence
Finding

The skill is explicitly designed to persist data across the session by writing, appending, deleting, and moving local files. Persistence is not inherently malicious, but it creates a real security concern because sensitive outputs, prompts, or derived artifacts may remain on disk and be modified or reused in unintended ways.

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)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The safety section claims cwd sandboxing, but later examples and configuration describe absolute-path writes and home-directory logging outside that boundary. Contradictory safety documentation is dangerous because operators may rely on the sandbox claim when enabling the skill, while actual usage patterns normalize broader filesystem access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill metadata and description present a narrower capability set than the actual exposed commands, which also include directory creation and file deletion. This mismatch can mislead users, reviewers, or policy layers into granting access under false assumptions, increasing the chance of destructive file operations being invoked unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code accepts actions including file-write, file-append, file-mkdir, and file-delete, then executes an external shell script via child_process without any confirmation prompt or user-visible warning in the code path. Although the skill description mentions file I/O generally, it does not specifically disclose deletion or shell execution behavior, and there are no logs, prompts, comments, or other user disclosures around these safety-relevant operations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest says the skill can read, write, append, and list local files in the working directory, but the CLI also exposes mkdir and delete actions. Creating directories and deleting files are materially broader behaviors than the stated description and are not implied by the listed capabilities.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The safety comment states paths are resolved within the cwd, but the function only strips a leading slash and rejects ..; it does not canonicalize or verify that the final target stays under the intended workspace. This can create a false sense of security, and in contexts with symlinks or manipulated CWD, file operations may reach unintended locations despite the apparent guard.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code path deletes a file with rm after only validating existence and hidden-file status. While the action name implies deletion, there is no confirmation prompt, warning message, or inline disclosure at the point of execution to alert users before the irreversible operation occurs.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description advertises broader capabilities such as directory traversal, search, move, and delete, which exceed the narrower stated purpose of safely reading, writing, appending, and listing files in the workspace. Overstating capabilities can normalize unnecessary privilege requests and encourage use beyond the intended trust boundary, increasing the chance of destructive or policy-violating file operations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Granting delete permission across the entire workspace is broader than necessary for a skill described primarily as a local file manager for persisting output and reading input safely. If the skill is misused, compromised, or invoked incorrectly, this permission enables irreversible destruction of user data within the workspace.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The trigger list includes multiple Chinese-only activation terms such as '文件', '读取', '写入', '写文件', and '读文件', but the skill does not document that it is intended specifically for Chinese-language users or offer any language/locale choice. This creates a natural-language policy concern because the skill behavior is partially scoped by language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest description is written entirely in Chinese, which may impose a language expectation on users without any documented opt-in or locale justification. The policy requires avoiding fixed language constraints unless the skill clearly offers a choice or documents a justified region-specific scope.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.