Back to skill

Security audit

auto-drive

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its Auto-Drive memory purpose, but recalled memory chains can be accepted from untrusted CIDs without proof of origin and API-key handling has exposure risks.

Review before installing. Only recall memory chains from CIDs you trust, inspect recalled JSON before importing it into agent memory, and assume Auto-Drive uploads are public and effectively permanent. Do not upload secrets or personal data unless encrypted locally. Avoid passing API keys as command arguments or typing them in a visible recorded terminal; rotate the key if exposed.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:209
Finding

Untrusted CID Content Can Be Treated as Authoritative Agent Memory

Content
View full analysis
/dev/null \ || true) # Fall back to public gateway if the API fails. if [[ -z "$EXPERIENCE" ]] || ! echo "$EXPERIENCE" | jq empty 2>/dev/null; then GATEWAY_URL="https://gateway.autonomys.xyz/file/$CID" EXPERIENCE=$(curl -sS --fail "$GATEWAY_URL" 2>/dev/null || true) # Additional decompression fallback omitted here only where it does not # affect the trust decision. fi # Validate JSON if ! echo "$EXPERIENCE" | jq empty 2>/dev/null; then echo "Warning: Non-JSON response for CID $CID — chain broken at depth $((COUNT + 1))" >&2 break fi if [[ -n "$OUTPUT_DIR" ]]; then echo "$EXPERIENCE" > "$OUTPUT_DIR/$(printf '%04d' $COUNT)-$CID.json" else echo "$EXPERIENCE" fi PREV=$(echo "$EXPERIENCE" | jq -r '.header.previousCid // .previousCid // empty' 2>/dev/null || true) CID="${PREV:-}" ``` ### Technical Analysis The recall operation accepts any syntactically valid CID and retrieves the corresponding JSON. It verifies only that: 1. The supplied identifier matches the expected CID format. 2. The downloaded content is valid JSON. 3. Each next-chain pointer resembles a CID. These checks provide content integrity and structural validity, but they do not establish provenance or authorization. The implementation does not verify a signature, expected account, trusted genesis node, approved head CID, or authenticated chain manife ...[truncated 2226 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/autodrive-download.sh:24
Finding

Download Destination Restriction Can Be Bypassed Through a Leaf Symlink

Content
View full analysis
&2; exit 1 fi OUTPUT_DIR_PART="$(dirname "$OUTPUT")" OUTPUT_BASE="$(basename "$OUTPUT")" OUTPUT_RESOLVED="$(cd "$OUTPUT_DIR_PART" 2>/dev/null && pwd -P)/$OUTPUT_BASE" || { echo "Error: Could not resolve output path — directory does not exist: $OUTPUT_DIR_PART" >&2; exit 1 } HOME_REAL="$(cd "$HOME" && pwd -P)" if [[ "$OUTPUT_RESOLVED" != "$HOME_REAL/"* ]]; then echo "Error: Output path must be within home directory" >&2 exit 1 fi OUTPUT="$OUTPUT_RESOLVED" fi ``` ```bash download_to_file() { local URL="$1" DEST="$2" shift 2 RESPONSE=$(curl -sS -w "\n%{http_code}" "$URL" "$@" -o "$DEST") echo "$RESPONSE" | tail -1 } ``` ```bash HTTP_CODE=$(download_to_file "$AD_DOWNLOAD_API/downloads/$CID" "$OUTPUT" "${AUTH_ARGS[@]}") if [[ "$HTTP_CODE" -ge 200 && "$HTTP_CODE" -lt 300 ]]; then echo "Saved to: $OUTPUT" >&2 else echo "Error: API download failed (HTTP $HTTP_CODE) — trying gateway" >&2 HTTP_CODE=$(download_to_file "$GATEWAY/file/$CID" "$OUTPUT") fi ``` ### Technical Analysis The path validation physically resolves the destination's parent directory but appends the basename without checking the final filesystem object. Consequently, an existing destination filename may be a symbolic link whose target is outside `$HOME`. The string stored in `OUTPUT` still appears to reside under `$HOME`, so it passes the boundary check. When `curl -o "$DEST"` opens that path, the operating system follows the final symlink and writes to its target. The vulnerability is a time-of-check/time-of-use and incomplete c ...[truncated 1587 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Reject non-regular existing destinations, including devices, FIFOs, and sockets. 3. Download into a securely created temporary regular file inside the validated destination directory: ```bash TMP=$(mktemp "$OUTPUT_DIR_PART/.autodrive-download.XXXXXX") chmod 600 "$TMP" ``` 4. After a successful download, revalidate the destination and atomically rename the temporary file into place. 5. Refuse overwriting existing files by default, or require an explicit `--force` option. 6. Where supported, use file-opening mechanisms that enforce `O_NOFOLLOW` and exclusive creation. 7. Recheck the physical destination directory immediately before the final rename to reduce race conditions. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/autodrive-recall-chain.sh:179
Finding

Predictable Recall Output Files Can Follow Attacker-Controlled Symlinks

Content
View full analysis
&2; exit 1 fi HOME_REAL="$(cd "$HOME" && pwd -P)" if [[ "$OUTPUT_DIR" != /* ]]; then OUTPUT_DIR_CHECK="$(pwd -P)/$OUTPUT_DIR" else OUTPUT_DIR_CHECK="$OUTPUT_DIR" fi if [[ "$OUTPUT_DIR_CHECK" == "$HOME/"* ]]; then OUTPUT_DIR_CHECK="$HOME_REAL/${OUTPUT_DIR_CHECK#"$HOME/"}" elif [[ "$OUTPUT_DIR_CHECK" == "$HOME" ]]; then OUTPUT_DIR_CHECK="$HOME_REAL" fi if [[ "$OUTPUT_DIR_CHECK" != "$HOME_REAL" && "$OUTPUT_DIR_CHECK" != "$HOME_REAL/"* ]]; then echo "Error: Output directory must be within home directory" >&2 exit 1 fi mkdir -p "$OUTPUT_DIR_CHECK" OUTPUT_DIR="$(cd "$OUTPUT_DIR_CHECK" && pwd -P)" if [[ "$OUTPUT_DIR" != "$HOME_REAL" && "$OUTPUT_DIR" != "$HOME_REAL/"* ]]; then echo "Error: Output directory resolves outside home directory (symlink?)" >&2 exit 1 fi fi ``` ```bash if [[ -n "$OUTPUT_DIR" ]]; then echo "$EXPERIENCE" > "$OUTPUT_DIR/$(printf '%04d' $COUNT)-$CID.json" echo "[$COUNT] Saved $CID" >&2 else echo "$EXPERIENCE" fi ``` ### Technical Analysis The script correctly validates the physical output directory, including a post-creation check intended to catch directory symlinks. However, it does not inspect the individual output files before opening them. Output filenames are predictable because they are derived from the traversal index and public CID: ```text 0000-.json 0001-.json ``` If a file with the expected name already exists as a symbolic link, shell redirection fol ...[truncated 1348 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Create files exclusively so an attacker cannot insert a symlink between checking and writing. 3. Prefer a secure temporary regular file created with `mktemp` inside the validated directory, followed by an atomic rename. 4. Set restrictive permissions such as `0600` on recalled memory files. 5. Consider creating a new private output directory with mode `0700` for every recall operation rather than accepting a shared directory. 6. If overwriting is necessary, require an explicit option and verify that the existing destination is a regular file owned by the current user with an acceptable link count. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup-auto-drive.sh:43
Finding

API Keys Are Exposed Through Echoed Prompts and Command-Line Arguments

Content
View full analysis
&2 exit 1 fi API_KEY="${API_KEY//[[:space:]]/}" ``` ### Technical Analysis Both interactive prompts use `read -r` without the `-s` option. Consequently, the API key is displayed on the terminal as it is entered. This can expose the credential to shoulder surfing, terminal recording, screen sharing, or session logs. The update script also accepts the API key as the first positional argument. Command-line secrets may be exposed through: - Shell history. - Process listings while the command is running. - Process accounting or monitoring systems. - CI/CD job logs. - Wrapper scripts that log complete command lines. The scripts subsequently save the key to files with mode `0600`, which is an appropriate local permission control. The issue is specifically the insecure input channels used before persistence. ### Attack Path #### Interactive exposure 1. The user runs the setup or update script in a visible, recorded, or shared terminal. 2. The user pastes the API key at the prompt. 3. Because silent input is not enabled, the key appears on screen. 4. An observer or recording captures the credential. 5. The attacker reuses it against the Auto-Dr ...[truncated 1043 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about persistent agent memory storage and recovery on the Autonomys Network from a CID. The supplied code does not implement memory-chain creation, decision/context storage, retrieval, or reconstruction from a CID. Instead, it is a support library for Auto-Drive configuration: it checks for required tools, validates CID format superficially, calls a remote API to verify an API key, and writes that key to local config files. These behaviors represent a materially different purpose centered on authentication/setup rather than durable memory management.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description emphasizes persistent agent memory storage and reconstruction of history on the Autonomys Network. The provided code does not implement saving, chaining, indexing, or reconstructing memory. Its sole function is to download content addressed by a CID, either to stdout or to a local file, with validation and fallback between API and gateway endpoints. While downloading by CID could be a supporting piece of a larger memory system, this chunk’s primary behavior is materially different from the declared purpose and omits the core promised capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description promises a specialized persistent agent-memory system on the Autonomys Network, including storing structured agent state and rebuilding full history from a CID. The actual code only implements a generic file upload utility to Auto-Drive. It takes a file path, determines MIME type, creates an upload, sends one chunk, completes the upload, validates the returned CID, and prints it. There is no logic for memory chains, no reconstruction of history, no agent-state semantics, and no identity/decision/context management. While both involve storage and CIDs on related infrastructure, the primary purpose and capabilities are materially different.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description is about persistent agent memory storage and reconstruction on the Autonomys Network. The supplied code does not implement memory saving, memory-chain creation, CID-based recovery, or any data persistence logic beyond storing an API key locally. Its primary purpose is credential setup for Auto-Drive: opening a browser to obtain an API key, prompting the user to paste it, verifying the key, and saving it into local configuration files. These are materially different behaviors from the declared purpose, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about persistent agent memory storage and recovery on the Autonomys Network. The supplied code does not implement memory storage, history reconstruction, CID handling, identity/context persistence, or any Autonomys Network interaction. Instead, it is a credential-management utility for updating an Auto-Drive API key and applying it to an OpenClaw gateway setup. This is a materially different primary purpose and capability set from the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about durable agent memory storage and recovery on the Autonomys Network. The actual code does not store or retrieve memory, manage CIDs, rebuild history, or handle agent identity/context chains. Instead, it performs environment and account verification for an Auto-Drive service: checks dependencies, validates an API key, and reports upload limits and usage. This is a materially different primary purpose, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/autodrive-recall-chain.sh [cid] [--limit N] [--output-dir DIR]

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/autodrive-recall-chain.sh [cid] [--limit N] [--output-dir DIR]

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/_lib.sh (reported line 10)May include surrounding context.

sh
AD_API_BASE="https://mainnet.auto-drive.autonomys.xyz/api"
AD_DOWNLOAD_API="https://public.auto-drive.autonomys.xyz/api"
AD_OPENCLAW_DIR="${OPENCLAW_DIR:-$HOME/.openclaw}"
AD_ENV_FILE="$AD_OPENCLAW_DIR/.env"
AD_CONFIG_FILE="$AD_OPENCLAW_DIR/openclaw.json"

GREEN='\033[0;32m'

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The function persists an API key into a plaintext .env file, which creates a durable local secret that may later be read by other processes, included in backups, or accidentally exposed through debugging or support workflows. Although the code attempts to protect the file with mode 600, plaintext secret storage still increases compromise impact on multi-user or malware-infected hosts.

Content

Scanner excerpt · scripts/_lib.sh (reported line 128)May include surrounding context.

sh
fi
  echo -e "${GREEN}✓ Saved to $AD_CONFIG_FILE${NC}"

  # --- .env ------------------------------------------------------------------
  # Remove any existing AUTO_DRIVE_API_KEY lines first to prevent duplicates,
  # then append exactly one entry.
  if [[ -f "$AD_ENV_FILE" ]]; then

Credential Access

High
Category
Privilege Escalation
Confidence
87% confidence
Finding

This line appends the API key directly into a shell-readable .env file, making the credential recoverable in plaintext by anyone or anything that gains access to the user's account or filesystem. The skill context makes this more sensitive because the key grants access to persistent remote storage tied to the agent's memory chain, so theft could expose or manipulate stored data.

Content

Scanner excerpt · scripts/_lib.sh (reported line 138)May include surrounding context.

sh
sed '/^AUTO_DRIVE_API_KEY=/d' "$AD_ENV_FILE" > "$sedtmp" && mv "$sedtmp" "$AD_ENV_FILE"
  fi
  # Single-quote the value so characters like #, $, and backticks are
  # preserved literally when the .env file is later sourced by bash.
  local safe_key="${key//\'/\'\\\'\'}"
  echo "AUTO_DRIVE_API_KEY='${safe_key}'" >> "$AD_ENV_FILE"
  chmod 600 "$AD_ENV_FILE"

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/autodrive-recall-chain.sh (reported line 152)May include surrounding context.

sh
if [[ -n "$EXPERIENCE" ]] && echo "$EXPERIENCE" | jq empty 2>/dev/null; then
      echo "[$COUNT] Fetched $CID via gateway" >&2
    else
      # ZLIB compressed — pipe curl directly into decompressor (no intermediate variable)
      EXPERIENCE=""
      if command -v python3 &>/dev/null; then
        EXPERIENCE=$(curl -sS --fail "$GATEWAY_URL" 2>/dev/null \

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/autodrive-recall-chain.sh (reported line 159)May include surrounding context.

sh
| python3 -c "import sys,zlib;sys.stdout.buffer.write(zlib.decompress(sys.stdin.buffer.read()))" 2>/dev/null || true)
      fi
      if [[ -z "$EXPERIENCE" ]] && command -v perl &>/dev/null; then
        EXPERIENCE=$(curl -sS --fail "$GATEWAY_URL" 2>/dev/null \
          | perl -MCompress::Zlib -e 'undef $/;my $d=uncompress(<STDIN>);print $d if defined $d' 2>/dev/null || true)
      fi
      if [[ -n "$EXPERIENCE" ]]; then

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares shell-capable behavior but does not define any explicit tool scope such as allowed tools or permissions. In an agent environment, that omission can let the model invoke broader shell functionality than users expect, increasing the chance of unintended command execution, file access, or network operations during setup, upload, download, and memory-chain actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough that ordinary requests containing words like 'save', 'remember', 'download', or 'load history' could invoke permanent decentralized storage or external retrieval unexpectedly. In this skill's context, unintended invocation is more dangerous because actions may upload public immutable data, modify local memory state, or fetch untrusted remote content with shell scripts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document instructs users to place a bearer API key directly in requests but provides no warning about treating that key as a secret, avoiding logs/client-side exposure, or using secure storage. In an agent skill context, this omission is risky because agents often echo configs, persist memory, or include headers in debugging output, which can leak credentials and enable unauthorized uploads, deletes, publishes, or account access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The reference states that downloads are public and that CIDs are permanent and cannot be deleted, but it does not clearly warn users not to upload secrets, personal data, or other sensitive content. In this skill's context—marketed as durable agent memory and identity storage—this is more dangerous because users may store conversation history, decisions, or credentials, creating irreversible public exposure and long-term privacy harm.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document strongly promotes permanent, non-expiring storage and agent memory resurrection, but it does not warn that any sensitive prompts, personal data, secrets, or erroneous content written to the network may be effectively irreversible and publicly retrievable. In the context of an agent-memory skill, this omission is security-relevant because operators may store high-risk data under the assumption it can later be deleted or rotated like normal application storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document encourages storing arbitrary agent memories on permanent decentralized storage and emphasizes permanence, portability, and full reconstruction from a single CID, but it does not warn that these memories may be publicly accessible and effectively irreversible once published. In the context of agent memory, this can expose sensitive prompts, credentials, decisions, personal data, or operational context, and the linked-list design makes complete history recovery straightforward for anyone with the head CID.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The optional smart-contract registry is presented as a resilience feature, but publishing the latest CID on a public blockchain creates a durable, globally readable pointer to an agent's full memory chain. Because the chain can be traversed backward from the head CID, on-chain registration materially increases discoverability, attribution, and linkability of the agent's historical memory data.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/_lib.sh (reported line 24)May include surrounding context.

sh
# Usage: ad_install_hint <pkg> [pkg ...]
ad_install_hint() {
  case "$(uname -s 2>/dev/null)" in
    Linux*)               echo "  Install: sudo apt install $*" >&2 ;;
    Darwin*)              echo "  Install: brew install $*" >&2 ;;
    MINGW*|MSYS*|CYGWIN*) echo "  Install: winget install $* OR choco install $*" >&2 ;;
    *)                    echo "  Install: $*" >&2 ;;

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/_lib.sh (reported line 98)May include surrounding context.

sh
local key="$1"

  mkdir -p "$AD_OPENCLAW_DIR"
  chmod 700 "$AD_OPENCLAW_DIR"

  # Collect temp files for cleanup
  _AD_TMPS=()

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/_lib.sh (reported line 116)May include surrounding context.

sh
jq -n --arg key "$key" \
      '{"skills": {"entries": {"auto-drive": {"enabled": true, "apiKey": $key}}}}' \
      > "$newtmp" && mv "$newtmp" "$AD_CONFIG_FILE"
    chmod 600 "$AD_CONFIG_FILE"
  else
    local jsontmp
    jsontmp=$(mktemp)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/_lib.sh (reported line 124)May include surrounding context.

sh
jq -n --arg key "$key" \
      '{"skills": {"entries": {"auto-drive": {"enabled": true, "apiKey": $key}}}}' \
      > "$newtmp" && mv "$newtmp" "$AD_CONFIG_FILE"
    chmod 600 "$AD_CONFIG_FILE"
  else
    local jsontmp
    jsontmp=$(mktemp)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/_lib.sh (reported line 141)May include surrounding context.

sh
jq -n --arg key "$key" \
      '{"skills": {"entries": {"auto-drive": {"enabled": true, "apiKey": $key}}}}' \
      > "$newtmp" && mv "$newtmp" "$AD_CONFIG_FILE"
    chmod 600 "$AD_CONFIG_FILE"
  else
    local jsontmp
    jsontmp=$(mktemp)

Static analysis

No suspicious patterns detected.