Back to skill

Security audit

Agent Audit

Security checks for vulnerabilities and agentic risk

Overview

This skill is an agent-account audit tool, but it handles credentials and database access in an overprivileged and under-disclosed way that needs careful review before use.

Install only if you fully control the OpenClaw environment, the listed ADC host, and every account being audited. Before running it, remove hardcoded secrets, rotate the exposed PostgreSQL password, replace root SSH and superuser database access with scoped read-only credentials, require an explicit account or workspace allowlist, use HTTPS and verified host keys, and keep remediation role changes outside this audit skill behind a separate approved workflow.

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 (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/audit.sh:8
Finding

Bulk Credential Collection Transmitted Through Unverified Remote SSH Host

Content
View full analysis
/dev/null | sed "s/^${key}=//" | tr -d '"'"'" } test_login() { local email="$1" password="$2" local result result=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no "root@$ADC_HOST" \ "curl -s -m 10 '$ADC_API/auth/login' -H 'Content-Type: application/json' -d '{\"email\":\"$email\",\"password\":\"$password\"}'" 2>/dev/null || echo '{}') if echo "$result" | grep -q '"accessToken"'; then echo "$result" | python3 -c "import sys,json; d=json.loads(sys.stdin.read()); print(d['user']['role'])" 2>/dev/null else echo "FAIL:$(echo "$result" | python3 -c "import sys,json; print(json.loads(sys.stdin.read()).get('message','unknown'))" 2>/dev/null)" fi } while IFS= read -r env_file; do email=$(get_env "$env_file" "ADC_EMAIL") [ -z "$email" ] && email=$(get_env "$env_file" "ADC_EMAIL") [ -z "$email" ] && continue password=$(get_env "$env_file" "ADC_PASSWORD") [ -z "$password" ] && password=$(get_env "$env_file" "ADC_PASSWORD") [ -z "$password" ] && continue result=$(test_login "$email" "$password") done < <(find "$GROUPS_DIR" -maxdepth 2 -name ".env" -not -path "*/ARCHIVE/*" -not -path "*/.trash/*" 2>/dev/null | sort) ``` ### Technical Analysis The script enumerates all matching workspace `.env` files and extracts each `ADC_EMAIL` and `ADC_PASSWORD`. It then embeds those credentials in a command sent to a fixed remote host over SSH. Although credential validation is part of the declared audit functionality, the implementation exceeds reasonable minimum privilege and confidentiality requiremen ...[truncated 1586 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/audit.sh:34
Finding

Remote Root Command Injection Through Unsafely Interpolated Environment Credentials

Content
View full analysis
/dev/null || echo '{}') if echo "$result" | grep -q '"accessToken"'; then echo "$result" | python3 -c "import sys,json; d=json.loads(sys.stdin.read()); print(d['user']['role'])" 2>/dev/null else echo "FAIL:$(echo "$result" | python3 -c "import sys,json; print(json.loads(sys.stdin.read()).get('message','unknown'))" 2>/dev/null)" fi } ``` The values passed to this function originate from workspace-controlled files: ```bash email=$(get_env "$env_file" "ADC_EMAIL") password=$(get_env "$env_file" "ADC_PASSWORD") result=$(test_login "$email" "$password") ``` ### Technical Analysis The email and password are inserted directly into a nested shell command. Shell quoting in the local script does not safely encode these values for the second shell that interprets the command on the remote system. A value containing quotes, command substitutions, separators, or other shell metacharacters can terminate the intended JSON string and alter the remote command. The same values are also not JSON-encoded. Even without command execution, quotes, backslashes, or control characters can corrupt the request body and produce incorrect audit results. The security impact is amplified because the injected command is sent to `root@$ADC_HOST`. Therefore, a malicious `.env` file can turn a credential audit into remote root command execution. ### Attack Path 1. An attacker gains the ability to create or modify a `.env` file beneath `GROUPS_DIR`. 2. The attacker places shell syntax in `ADC_EMAIL` or `ADC_PASSWORD ...[truncated 759 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/role-audit.sh:15
Finding

Hardcoded PostgreSQL Credential and Excessive Root-Level Database Access

Content
View full analysis
/dev/null) ``` ### Technical Analysis A live-looking PostgreSQL password is embedded directly in the distributed script. Anyone who can read the Skill package can recover the password. It can also be exposed through process listings because it is supplied as part of the remote Docker command. The script connects as the PostgreSQL superuser and accesses the remote host as `root`, despite performing only a read-only query over three user-table columns. This creates multiple unnecessary privilege boundaries: - Root SSH access to the ADC host - Ability to launch Docker containers on an internal network - PostgreSQL superuser authentication - Direct access to the application database A role-comparison audit requires only a narrowly scoped, read-only database identity or API endpoint. ### Attack Path 1. An attacker obtains a copy of the Skill package or reads the script from an installed environment. 2. The attacker extracts the plaintext PostgreSQL password and infrastructure connection details. 3. If the database is reachable directly or through another compromised component, the attacker authenticates as the PostgreSQL `postgres` user. 4. Alternatively, an attacker with SSH access can reproduce the documented Docker command on the internal network. 5. The superuser account is used to read, alter, or destroy application data and database permissions. ### Impact Assessment The hardcoded credential potentially grants PostgreSQL ...[truncated 373 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/role-audit.sh:20
Finding

Local Python Code Injection Through Database Output Embedded in a Heredoc

Content
View full analysis
/dev/null) ``` ### Technical Analysis The heredoc delimiter is unquoted, so the shell performs parameter expansion before Python receives the program. `DB_DATA` is consequently inserted into Python source code inside a triple-quoted string. If a queried database field contains a triple-quote terminator followed by valid Python statements, it can escape the intended string literal and become executable Python code. Other special sequences can also corrupt the generated source and cause denial of service. Database records must be handled as data, not inserted into executable source. The manifest path is likewise interpolated into the Python source and should be passed as an argument or environment value. ### Attack Path 1. An attacker obtains permission to create or modify a queried `users` table value, such as an email, role, or internal-role field. 2. The attacker stores content designed to terminate the Python triple-quoted string and append Python statements. 3. An operator executes `scripts/role-audit.sh`. 4. The database output is assigned to `DB_DATA`. 5. The unquoted heredoc expands `DB_DATA` directly into the Python program. 6. Python parses and executes the injected statements with the ...[truncated 397 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:29
Finding

Audit Skill Documents Privileged Remote Database Mutation Workflow

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared scope overstates broad password, workspace, and health auditing while the described implementation is narrower and omits clear disclosure of database/remote access requirements. This mismatch can cause operators to invoke a skill under false assumptions about what it will inspect and what systems it will touch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared scope overstates broad password, workspace, and health auditing while the described implementation is narrower and omits clear disclosure of database/remote access requirements. This mismatch can cause operators to invoke a skill under false assumptions about what it will inspect and what systems it will touch.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation says the audit tests agent email/password logins against the ADC API, but the skill description does not warn users that it performs live authentication attempts. Hidden credential validation against a remote service is sensitive because it can touch real accounts, generate audit events, and normalize handling of passwords without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script reads credentials from local .env files and submits them to an API endpoint over plain HTTP, embedding them in a remotely executed shell command. This exposes secrets to interception on the network, to logging/inspection on the remote host, and to credential leakage through shell/process visibility.

Content

No source excerpt is available for this finding.

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/audit.sh (reported line 80)May include surrounding context.

sh
$is_weak && weak_tag=" ⚠️ DEFAULT PASSWORD"
      echo "  ✅ $ws ($email): role=$result$weak_tag"
    fi
  done < <(find "$GROUPS_DIR" -maxdepth 2 -name ".env" -not -path "*/ARCHIVE/*" -not -path "*/.trash/*" 2>/dev/null | sort)
  echo ""
  echo "  Total: $total | OK: $ok | Failed: $fail | Weak: $weak"
  echo ""

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/audit.sh (reported line 114)May include surrounding context.

sh
$is_weak && weak_tag=" ⚠️ DEFAULT PASSWORD"
      echo "  ✅ $ws ($email): role=$result$weak_tag"
    fi
  done < <(find "$GROUPS_DIR" -maxdepth 2 -name ".env" -not -path "*/ARCHIVE/*" -not -path "*/.trash/*" 2>/dev/null | sort)
  echo ""
  echo "  Total: $total | OK: $ok | Failed: $fail | Weak: $weak"
  echo ""

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The audit script embeds direct privileged infrastructure access by SSHing as root to a hard-coded host and then running a database client with elevated connectivity. In a skill specifically meant to audit agent accounts and roles, this creates unnecessary trust and blast radius: anyone invoking or modifying the script gains a pathway into sensitive infrastructure beyond simple local manifest comparison.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script accesses a production-like database over SSH using a hard-coded database password and silently suppresses errors, with no warning, confirmation, or indication to the user that live remote data is being queried. This exposes credentials in source, normalizes secret reuse, and makes accidental or unauthorized access to sensitive account-role data much more likely in an auditing workflow that may be run routinely.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes shell scripts and documents remote-impacting operations, but it declares no explicit tool scope or allowed tools. That omission removes an important policy boundary, increasing the chance the skill is auto-invoked with broader execution capability than users expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

A trigger like "check passwords" is broad and likely to match unrelated user requests, causing this skill to activate outside its intended context. Because the skill can lead to shell execution and external account auditing, overbroad activation materially increases the risk of unintended sensitive actions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script performs authentication probes by opening an SSH session as root to the ADC host and explicitly disables SSH host key verification. That creates a man-in-the-middle risk and unnecessarily grants remote-shell execution capability for a task that only needs to call an API, increasing the blast radius if the host or network path is compromised.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
98% confidence
Finding

The code transmits usernames and passwords to an external service endpoint as part of the login test. In the context of an auditing skill that enumerates many agent accounts, this mass external transmission of credentials is especially dangerous because it centralizes and exposes sensitive authentication material during routine audits.

Content

Scanner excerpt · scripts/audit.sh (reported line 41)May include surrounding context.

sh
local email="$1" password="$2"
  local result
  result=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no "root@$ADC_HOST" \
    "curl -s -m 10 '$ADC_API/auth/login' -H 'Content-Type: application/json' -d '{\"email\":\"$email\",\"password\":\"$password\"}'" 2>/dev/null || echo '{}')
  if echo "$result" | grep -q '"accessToken"'; then
    echo "$result" | python3 -c "import sys,json; d=json.loads(sys.stdin.read()); print(d['user']['role'])" 2>/dev/null
  else

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script emits audit status messages in Chinese only, such as the title and mismatch summaries, with no option to select locale or language. This is a natural-language policy concern because it imposes a specific language on all users without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This JSON manifest contains user-facing natural-language fields such as "dept" and "name" in Chinese, and that pattern continues throughout the file. Because the file provides no indication of locale selection, opt-in, or region-specific justification, it appears to enforce a specific language setting in a way that may violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script detects expected ADC work by grepping for specific Chinese phrases such as "开发", "需求", and "巡检" in SOUL.md. This embeds a language-specific assumption into skill behavior without user opt-in or documentation that the audit only supports Chinese-language role descriptions.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.