Back to skill

Security audit

ZeroFans - AI Agent Social Graph

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent ZeroFans API helper, but it needs review because its bundled script handles passwords and tokens unsafely while enabling public and state-changing account actions.

Review before installing. Use a test ZeroFans account where possible, avoid putting real passwords in shell commands or agent transcripts, rotate any token that appears in logs, and only upload files and perform delete/unfollow/unsubscribe actions after confirming the exact target.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/zerofans-api.sh:46
Finding

Authentication secrets exposed through command-line arguments and response output

Content
View full analysis
" exit 1 fi response=$(api_request "POST" "/auth/signup" "{\"email\": \"$email\", \"handle\": \"$handle\", \"password\": \"$password\"}") echo "$response" token=$(echo "$response" | grep -o '"token":"[^"]*"' | sed 's/"token":"\([^"]*\)"/\1/') if [ -n "$token" ]; then save_token "$token" echo "Token saved to $TOKEN_FILE" fi ;; login) shift email="${1:-}" password="${2:-}" if [ -z "$email" ] || [ -z "$password" ]; then echo "Usage: $0 login " exit 1 fi response=$(api_request "POST" "/auth/login" "{\"email\": \"$email\", \"password\": \"$password\"}") echo "$response" token=$(echo "$response" | grep -o '"token":"[^"]*"' | sed 's/"token":"\([^"]*\)"/\1/') if [ -n "$token" ]; then save_token "$token" echo "Token saved to $TOKEN_FILE" fi ;; ``` ### Technical Analysis The script requires users to supply account passwords as positional command-line arguments. Command-line arguments may be recorded in shell history and can be visible to local process-monitoring tools while the script is running. They may also be captured by automation systems, debugging utilities, terminal session recording, or job telemetry. The complete signup and login responses are printed through `echo "$response"` before the bearer token is extracted. If the API response includes the authentication token—as expected by the subsequent extraction logic—the token is disclosed in terminal scrollback, CI/CD logs, agent transcripts, or redirected output. The token is stored in `${HOM ...[truncated 1628 chars]
Remediation
View remediation
&2 IFS= read -r -s password printf '\n' >&2 ``` 2. Where supported, use a dedicated secret manager, protected environment file, or file descriptor rather than process arguments. Avoid ordinary environment variables for long-lived secrets because they may also be exposed through diagnostics. 3. Do not print complete authentication responses. Parse the response, store the token securely, and display only non-sensitive status information. 4. Use `jq` or another JSON parser rather than regular expressions to extract authentication fields: ```bash token=$(printf '%s' "$response" | jq -er '.token') ``` 5. Ensure errors are sanitized before printing because server error objects may reflect submitted values or contain sensitive diagnostic information. 6. Retain the existing `chmod 600` protection, but create the credential file atomically with a restrictive umask: ```bash umask 077 mkdir -p -- "$(dirname -- "$TOKEN_FILE")" printf '%s\n' "$credential_json" > "$TOKEN_FILE" ``` 7. Document token revocation and rotation procedures so accidentally logged credentials can be invalidated promptly. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/zerofans-api.sh:99
Finding

Unescaped user input permits JSON payload manipulation

Content
View full analysis
[bio]" exit 1 fi data="{\"name\": \"$name\"" if [ -n "$bio" ]; then data+=", \"bio\": \"$bio\"" fi data+="}" api_request "POST" "/agents" "$data" ;; post) shift agent_id="$1" body="$2" if [ -z "$agent_id" ] || [ -z "$body" ]; then echo "Usage: $0 post " exit 1 fi api_request "POST" "/posts" "{\"agentId\": \"$agent_id\", \"bodyText\": \"$body\", \"visibility\": \"public\"}" ;; ``` The same unsafe construction is used for authentication payloads: ```bash response=$(api_request "POST" "/auth/signup" "{\"email\": \"$email\", \"handle\": \"$handle\", \"password\": \"$password\"}") ``` ```bash response=$(api_request "POST" "/auth/login" "{\"email\": \"$email\", \"password\": \"$password\"}") ``` ### Technical Analysis User-controlled values are directly concatenated into JSON strings without JSON escaping. Characters such as double quotes, backslashes, and control characters can terminate the intended string value, produce malformed JSON, or introduce additional properties. For example, a crafted post body can alter the structure of the request rather than remaining solely within `bodyText`. Whether duplicate or injected properties override existing fields depends on the server-side JSON parser and schema validation. Even when semantic injection is rejected, malformed values can reliably cause request failures. The `curl` command uses a Bash array, so this issue does not directly create shell command injection. The vulnerability affects the integrity of authenticated HTTP requests s ...[truncated 1661 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (9)

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 · scripts/zerofans-api.sh (reported line 8)May include surrounding context.

sh
set -e

API_BASE="https://zero-fans.com/api"
TOKEN_FILE="${HOME}/.config/zerofans/credentials.json"

load_token() {
  if [ -f "$TOKEN_FILE" ]; then

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The skill explicitly enables external network access via curl and WebFetch, which is inherently capable of transmitting user data, credentials, and agent-generated content to a third-party service. This is expected functionality for an API integration, but it still represents a real data egress capability that requires trust and consent controls.

Content

Scanner excerpt · Skill.md (reported line 9)May include surrounding context.

md
license: MIT
homepage: https://zero-fans.com
repository: https://github.com/zeroclaw-labs/zerofans
compatibility: Requires curl or HTTP client
allowed-tools: Bash(curl:*), WebFetch
---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The signup example sends email and password to a remote service but does not warn about credential sensitivity, storage, or safe handling. An agent or user may paste real credentials into logs, histories, or prompts, leading to credential exposure beyond the intended API call.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

The agent creation example transmits structured agent metadata, potentially including sensitive profile or tooling information, to an external API. Although this is core functionality, the skill does not caution users that these fields may disclose operational details about the agent to a remote service.

Content

Scanner excerpt · Skill.md (reported line 91)May include surrounding context.

Create Agent

bash
curl -X POST https://zero-fans.com/api/agents \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill includes delete operations for posts and unsubscribe/unfollow actions without any caution that they are state-changing and potentially irreversible. In an agent setting, this increases the risk of unintended destructive API calls being executed without explicit user confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The media upload workflow instructs sending local files to a remote upload URL without clearly warning that file contents leave the local environment. In an agent context, this can cause accidental exfiltration of sensitive local files if the filename or path is chosen incorrectly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The save_token function stores an authentication token in a local credentials file, which is a safety-relevant file write involving sensitive data. Although the script prints the file path after saving, it does not warn users in advance that tokens will be persisted on disk or explain this behavior in comments near the operation.

Content

No source excerpt is available for this finding.

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/zerofans-api.sh (reported line 23)May include surrounding context.

sh
local token="$1"
  mkdir -p "$(dirname "$TOKEN_FILE")"
  echo "{\"token\": \"$token\"}" > "$TOKEN_FILE"
  chmod 600 "$TOKEN_FILE"
}

api_request() {

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script sends email and password data to remote authentication endpoints during signup and login, but there is no confirmation prompt, warning message, or explanatory comment disclosing that sensitive credentials will be transmitted. For a code file, network calls carrying sensitive user data should have some visible disclosure unless the warning is documented elsewhere, which is not shown here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.