Back to skill

Security audit

Secure Autofill

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent for 1Password autofill, but it asks users to store a service-account token and make persistent gateway/system changes without enough security safeguards.

Review this before installing if you plan to use a 1Password service-account token. Prefer the 1Password desktop integration when possible, avoid pasting tokens into chat, set any token-bearing env files to owner-only permissions, and manually approve any sudo, systemd, or gateway-env changes.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/onboard.sh:34
Finding

Insecure Collection and Storage of a 1Password Service-Account Token

Content
View full analysis

Vulnerability Details

File Location: scripts/onboard.sh:34-48, scripts/onboard.sh:88-94, and scripts/onboard.sh:112-140
Vulnerability Type: Plaintext sensitive-data handling and insecure file permissions
Risk Level: Medium

Vulnerable Code

bash
set_kv() {
  # set_kv <file> <KEY> <VALUE>
  local file="$1" key="$2" val="$3"
  mkdir -p "$(dirname "$file")"
  touch "$file"

  if grep -qE "^${key}=" "$file"; then
    # replace first occurrence
    # shellcheck disable=SC2016
    sed -i -E "0,/^${key}=.*/s//${key}=\"${val//\"/\\\"}\"/" "$file"
  else
    printf '%s="%s"\n' "$key" "$val" >> "$file"
  fi
}
bash
write_skill_local_env() {
  local disp="$1" wdisp="$2" token="$3"

  {
    echo "# secure-autofill env (machine-specific)"
    echo "# Example file: ${CFG_EXAMPLE}"
    echo ""
    echo "DISPLAY=\"${disp}\""
    echo "WAYLAND_DISPLAY=\"${wdisp}\""
    if [[ -n "$token" ]]; then
      echo "OP_SERVICE_ACCOUNT_TOKEN=\"${token}\""
    fi
  } > "$CFG_REAL"
}
bash
echo
echo "OP_SERVICE_ACCOUNT_TOKEN is optional if you use 1Password desktop integration."
read -r -p "OP_SERVICE_ACCOUNT_TOKEN (leave blank to skip): " token

echo
echo "About to write skill-local env:"
echo "  DISPLAY=\"$disp\""
echo "  WAYLAND_DISPLAY=\"$wdisp\""
if [[ -n "$token" ]]; then
  echo "  OP_SERVICE_ACCOUNT_TOKEN=<set>"
else
  echo "  OP_SERVICE_ACCOUNT_TOKEN=<empty>"
fi
read -r -p "Confirm? [y/N]: " ok
[[ "$ok" =~ ^[Yy]$ ]] || fail "aborted"

write_skill_local_env "$disp" "$wdisp" "$token"
echo "Wrote: $CFG_REAL"

echo
read -r -p "Update gateway env file ($GATEWAY_ENV)? [y/N]: " doenv
if [[ "$doenv" =~ ^[Yy]$ ]]; then
  echo "Ensuring: $GATEWAY_ENV"
  mkdir -p "$(dirname "$GATEWAY_ENV")"
  touch "$GATEWAY_ENV"

  prompt_apply_key "DISPLAY" "$disp" 0
  prompt_apply_key "WAYLAND_DISPLAY" "$wdisp" 
...[truncated 2922 chars]
Remediation
View remediation

Remediation Suggestions

  1. Collect the token without terminal echo:

    bash
    read -r -s -p "OP_SERVICE_ACCOUNT_TOKEN (leave blank to skip): " token
    printf '\n'
    
  2. Set a restrictive umask before creating or replacing any secret-bearing file:

    bash
    umask 077
    
  3. Explicitly enforce owner-only permissions after writing both environment files:

    bash
    chmod 600 "$CFG_REAL"
    chmod 600 "$GATEWAY_ENV"
    
  4. Write files through securely created temporary files in the same directory, apply mode 600, and atomically rename them into place. This avoids exposing partially written content and makes permission handling deterministic.

  5. Preserve restrictive permissions when updating an existing gateway environment file and reject files not owned by the current user.

  6. Validate values before serialization. Reject newline and carriage-return characters, and use a robust environment-file encoder rather than interpolating untrusted values directly into sed replacement expressions.

  7. Prefer avoiding persistent service-account tokens where possible. Use the 1Password desktop integration or another short-lived credential mechanism, and grant service accounts access only to the minimum required vaults and items.

  8. Add the documented config.env.example template to the package so onboarding behavior can be tested, then add automated tests verifying silent token input and mode 600 for every file containing credentials.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a credential-filling helper, but it also includes onboarding and host-configuration actions such as editing env files, handling a service account token, changing systemd service configuration, and restarting a gateway service. That mismatch increases the chance an operator or agent will approve broader, security-sensitive actions than expected, especially because those actions affect secret handling and service behavior beyond simple autofill.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

bash
# Add Google apt source
wget -qO- https://dl.google.com/linux/linux_signing_key.pub \
  | sudo gpg --dearmor -o /usr/share/keyrings/google-linux-signing-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-linux-signing-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
  | sudo tee /etc/apt/sources.list.d/google-chrome.list

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

bash
# Add Google apt source
wget -qO- https://dl.google.com/linux/linux_signing_key.pub \
  | sudo gpg --dearmor -o /usr/share/keyrings/google-linux-signing-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-linux-signing-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
  | sudo tee /etc/apt/sources.list.d/google-chrome.list

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

bash
# Add Google apt source
wget -qO- https://dl.google.com/linux/linux_signing_key.pub \
  | sudo gpg --dearmor -o /usr/share/keyrings/google-linux-signing-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-linux-signing-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
  | sudo tee /etc/apt/sources.list.d/google-chrome.list

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

bash
# Add Google apt source
wget -qO- https://dl.google.com/linux/linux_signing_key.pub \
  | sudo gpg --dearmor -o /usr/share/keyrings/google-linux-signing-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-linux-signing-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
  | sudo tee /etc/apt/sources.list.d/google-chrome.list

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

| sudo tee /etc/apt/sources.list.d/google-chrome.list

Install

sudo apt update && sudo apt install -y google-chrome-stable

text

### 2) Configure gateway environment (non-headless + 1Password token)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/onboard.sh (reported line 101)May include surrounding context.

sh
[[ -f "$CFG_EXAMPLE" ]] || fail "missing example: $CFG_EXAMPLE"

  echo "This will:"
  echo "  1) Write skill-local env values to: $CFG_REAL"
  echo "  2) Optionally update gateway env file: $GATEWAY_ENV"
  echo "Example (untouched): $CFG_EXAMPLE"
  echo

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

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

sh
read -r -p "OP_SERVICE_ACCOUNT_TOKEN (leave blank to skip): " token

  echo
  echo "About to write skill-local env:" 
  echo "  DISPLAY=\"$disp\""
  echo "  WAYLAND_DISPLAY=\"$wdisp\""
  if [[ -n "$token" ]]; then

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

These instructions direct the agent/user to write configuration files and potentially update the gateway environment without a clear safety warning or explicit consent boundary. Because the files may contain sensitive values like OP_SERVICE_ACCOUNT_TOKEN and alter runtime behavior, silent execution could lead to unintended secret persistence or misconfiguration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The installation section adds a third-party apt source and installs Chrome with elevated privileges, but it does not foreground that these are system-level changes. In an agent-executed context, package source changes and privileged installs materially expand the trust boundary and could be abused or performed without informed operator consent.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
86% confidence
Finding

This command uses sudo to write a keyring file under /usr/share/keyrings, which is a privileged system modification. While common for package setup, embedding root-requiring commands in a skill increases risk if an agent runs them automatically or if the command source is not independently validated.

Content

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

bash
# Add Google apt source
wget -qO- https://dl.google.com/linux/linux_signing_key.pub \
  | sudo gpg --dearmor -o /usr/share/keyrings/google-linux-signing-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-linux-signing-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
  | sudo tee /etc/apt/sources.list.d/google-chrome.list

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
87% confidence
Finding

This instruction uses sudo tee to write a new apt source file, which changes system package trust and update behavior. In the context of an agent skill, privileged repository configuration is more dangerous than ordinary documentation because it may be interpreted as an endorsed executable workflow.

Content

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

md
| sudo gpg --dearmor -o /usr/share/keyrings/google-linux-signing-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-linux-signing-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \
  | sudo tee /etc/apt/sources.list.d/google-chrome.list

# Install
sudo apt update && sudo apt install -y google-chrome-stable

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
87% confidence
Finding

Running sudo apt update && sudo apt install performs privileged package-management actions that alter the host system. Although not inherently malicious, including these commands in a skill without strong safeguards can lead to unintended or automatic root-level changes.

Content

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

| sudo tee /etc/apt/sources.list.d/google-chrome.list

Install

sudo apt update && sudo apt install -y google-chrome-stable

text

### 2) Configure gateway environment (non-headless + 1Password token)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

These steps create a persistent systemd user override and restart the openclaw-gateway service, changing how the gateway loads environment variables. Without a clear warning, an operator may not realize this establishes lasting service behavior and could cause secrets in ~/.config/openclaw/env to be loaded automatically on future runs.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The systemd override makes the gateway persistently load an environment file, which can create durable secret exposure if OP_SERVICE_ACCOUNT_TOKEN or similar values are stored there. Persistence is contextually significant here because the skill is about credential workflows, so lasting secret-loading behavior affects every future gateway session.

Content

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

  1. Ensure the gateway service loads the env file:
bash
mkdir -p ~/.config/systemd/user/openclaw-gateway.service.d
cat > ~/.config/systemd/user/openclaw-gateway.service.d/override.conf << 'EOF'
[Service]
EnvironmentFile=%h/.config/openclaw/env

Static analysis

No suspicious patterns detected.