Back to skill

Security audit

Openclaw File Exporter

Security checks for vulnerabilities and agentic risk

Overview

This skill clearly uploads files to a temporary hosting service, but it is too broadly scoped and can upload or overwrite local data without enough safeguards.

Review carefully before installing. Use only for files you are comfortable sending to tmpfile.link, treat returned links as public, avoid configs or credential-bearing directories, and do not pass untrusted custom archive names. A safer version should restrict export paths, block secrets by default, validate filenames, and ask for explicit confirmation before upload.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/export-and-upload.sh:23
Finding
Unrestricted Upload of Arbitrary Local Files to External Hosting<![CDATA[ ## Vulnerability Details **File Location**: `scripts/export-and-upload.sh:23-30, 89-101`; related capability documentation at `SKILL.md:10-19` **Vulnerability Type**: Missing source-path authorization and unrestricted external file transfer **Risk Level**: High ### Vulnerable Code ```bash if [ -z "$SOURCE_PATH" ]; then echo "Error: Source path is required" echo "Usage: export-and-upload.sh <source_path> [custom_name]" exit 1 fi if [ ! -e "$SOURCE_PATH" ]; then echo "Error: Source path does not exist: $SOURCE_PATH" exit 1 fi ``` ```bash # Execute upload if [ -n "$USER_ID" ] && [ -n "$AUTH_TOKEN" ]; then echo "Using authenticated upload" RESPONSE=$(curl -s -X POST \ -H "X-User-Id: $USER_ID" \ -H "X-Auth-Token: $AUTH_TOKEN" \ -F "file=@$ARCHIVE_PATH" \ https://tmpfile.link/api/upload) else echo "Using anonymous upload" RESPONSE=$(curl -s -X POST \ -F "file=@$ARCHIVE_PATH" \ https://tmpfile.link/api/upload) fi ``` The documented capability is similarly broad: ```markdown - Share OpenClaw files externally - Create backups of any OpenClaw-related files ``` ### Technical Analysis The script only verifies that the supplied source path exists. It does not canonicalize the path, restrict it to approved OpenClaw directories, reject sensitive files, prevent traversal through symbolic links, or request confirmation after displaying the resolved source and upload destination. Any file or directory readable by the account running the Skill can therefore be compressed and transferred to `tmpfile.link`. If authentication variables are absent, the script automatically falls back to an anonymous upload. The resulting download URL is printed to the caller. Although external export is the Skill's documented purpose, allowing arbitrary readable paths exceeds the least privilege needed to export a specifically approved Skill or configuration. In an agent environment, an unsafe reque ...[truncated 1434 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Canonicalize the source with `realpath` before any operation and reject paths that cannot be resolved safely. 2. Restrict exports to explicit allowlisted roots, such as approved OpenClaw Skill or configuration directories. 3. Verify that the canonical source remains inside an allowed root, including after resolving symbolic links. 4. Deny known-sensitive files and directories by default, including private keys, credential stores, environment files, tokens, browser data, and system authentication material. 5. Require explicit user confirmation immediately before upload. The confirmation should show: - The canonical source path. - Whether the source is a file or directory. - Archive size. - Destination hostname. - Whether the upload is anonymous or authenticated. 6. Avoid automatic anonymous upload of potentially sensitive material. Prefer authenticated and private storage where the service supports it. 7. Consider generating a manifest of archive contents and require approval before transfer. 8. Apply process-level sandboxing so the Skill can read only directories explicitly authorized for export. 9. Clearly warn users that possession of the returned link may grant access to the uploaded content. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/export-and-upload.sh:33
Finding
Custom Archive Name Allows Path Traversal and Arbitrary File Overwrite<![CDATA[ ## Vulnerability Details **File Location**: `scripts/export-and-upload.sh:33-58` **Vulnerability Type**: Path traversal and unsafe output-file construction **Risk Level**: High ### Vulnerable Code ```bash # Determine output filename if [ -n "$CUSTOM_NAME" ]; then OUTPUT_NAME="$CUSTOM_NAME" else BASENAME=$(basename "$SOURCE_PATH") # Add .tar.gz extension if not present if [[ "$BASENAME" != *.tar.gz ]]; then OUTPUT_NAME="${BASENAME}.tar.gz" else OUTPUT_NAME="$BASENAME" fi fi # Create temp directory for processing TEMP_DIR=$(mktemp -d) ARCHIVE_PATH="$TEMP_DIR/$OUTPUT_NAME" # Compress the source echo "Compressing $SOURCE_PATH..." if [ -d "$SOURCE_PATH" ]; then # If it's a directory, archive its contents tar -czf "$ARCHIVE_PATH" -C "$(dirname "$SOURCE_PATH")" "$(basename "$SOURCE_PATH")" else # If it's a file if [[ "$SOURCE_PATH" == *.tar.gz ]] || [[ "$SOURCE_PATH" == *.tgz ]]; then # Already compressed, just copy cp "$SOURCE_PATH" "$ARCHIVE_PATH" else # Compress the file tar -czf "$ARCHIVE_PATH" -C "$(dirname "$SOURCE_PATH")" "$(basename "$SOURCE_PATH")" fi fi ``` ### Technical Analysis The optional `CUSTOM_NAME` is accepted without validation and directly appended to the temporary-directory path: ```bash ARCHIVE_PATH="$TEMP_DIR/$OUTPUT_NAME" ``` Shell quoting prevents command injection, but it does not prevent filesystem path traversal. A custom name containing sufficient `../` components can resolve outside `TEMP_DIR`. The resulting path is then used as the destination of either `tar -czf` or `cp`, both of which can create or truncate a file at the resolved destination. The exploit is constrained by the filesystem permissions of the account running the script. It also requires the resolved parent directory to exist because the script does not create custom-name subdirectories. Nevertheless, an attacker who can control the second argument can overwrit ...[truncated 1627 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Treat the custom name strictly as a filename, not a path. Reject values containing `/`, `\`, `..`, control characters, or empty basename components. 2. Normalize the value with `basename` and verify that normalization did not change the submitted value. 3. Prefer generating the archive filename internally rather than allowing callers to supply it. 4. Canonicalize and verify the destination before writing. Its resolved parent must remain inside `TEMP_DIR`. 5. Use a restrictive filename allowlist, for example letters, digits, periods, underscores, and hyphens, with a reasonable maximum length. 6. Ensure the expected `.tar.gz` extension is applied after validation. 7. Prevent unintended overwrites by checking for destination existence and using no-clobber or exclusive-creation behavior. 8. Fail immediately if `mktemp`, `tar`, or `cp` returns a nonzero status. Enabling `set -euo pipefail` can improve failure handling, although explicit checks should still be used for security-sensitive operations. 9. A safe validation pattern could follow this approach: ```bash if [[ -n "$CUSTOM_NAME" ]]; then if [[ "$CUSTOM_NAME" == *"/"* || "$CUSTOM_NAME" == *"\\"* || "$CUSTOM_NAME" == *".."* || ! "$CUSTOM_NAME" =~ ^[A-Za-z0-9._-]+$ ]]; then echo "Error: Invalid custom archive name" exit 1 fi OUTPUT_NAME="$CUSTOM_NAME" fi ARCHIVE_PATH="$TEMP_DIR/$OUTPUT_NAME" ARCHIVE_PARENT=$(realpath -m -- "$(dirname -- "$ARCHIVE_PATH")") if [[ "$ARCHIVE_PARENT" != "$TEMP_DIR" ]]; then echo "Error: Archive destination escapes temporary directory" exit 1 fi ``` ]]>
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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (8)

Missing User Warnings

High
Confidence
96% confidence
Finding
The top-level skill description does not prominently warn that exported files are uploaded to a public external hosting service. Users or orchestrators may interpret 'export' or 'download' as a local-only action, leading to accidental disclosure of configuration files, skills, tokens, or other sensitive data.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill invokes a shell script capable of exporting arbitrary files, but the manifest declares no explicit tool scope or permissions boundaries. That creates an authorization ambiguity where a broadly callable skill may access and exfiltrate sensitive local files without clear platform-level restriction.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The description is broad enough to match general requests to export, backup, download, or share files, which increases the chance of unintended invocation. In this skill, unintended invocation is especially risky because its core action is packaging and uploading files to an external service.

Session Persistence

Medium
Category
Rogue Agent
Content
- Export/backup an OpenClaw skill
- Download configuration files
- Share OpenClaw files externally
- Create backups of any OpenClaw-related files

## Features
Confidence
81% confidence
Finding
The skill explicitly supports creating backups and sharing 'any OpenClaw-related files' externally, which can preserve and expose sensitive data beyond the local session. Because uploads go to tmpfile.link and may include configs or skills, this creates durable data exfiltration and persistence risk even if retention is temporary.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
https://d.tmpfile.link/public/2026-03-12/uuid/skill-security-auditor.tar.gz
========================================

Note: File will be automatically deleted after 7 days
```

## Limitations
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
https://d.tmpfile.link/public/2026-03-12/uuid/skill-security-auditor.tar.gz
========================================

Note: File will be automatically deleted after 7 days
```

## Limitations
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The core behavior is to compress a user-specified path and upload it to tmpfile.link, but the script provides no explicit pre-upload warning, consent gate, or sensitivity check before transmitting data to an external service. Because the skill advertises exporting configs, skills, or any other files, it can easily send secrets, tokens, or proprietary data off-host, making the context more dangerous rather than less.

Context-Inappropriate Capability

Medium
Confidence
87% confidence
Finding
The script reads upload-service credentials from environment variables and will automatically use them when present, enabling uploads under an authenticated account without an explicit opt-in at execution time. In a file-export skill that may handle configuration files, skills, or arbitrary paths, this increases the chance that sensitive data is exfiltrated to a third-party service with account attribution and longer-lived access semantics.

Static analysis

No suspicious patterns detected.