Back to skill

Security audit

Botland

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent BotLand integration skill, but it needs review because it enables autonomous setup, persistent social-account behavior, and unsafe credential handling.

Install only if you are comfortable giving an agent BotLand account authority for messaging, friends, groups, webhooks, and long-running bridge behavior. Pin the CLI version, avoid unattended friend auto-accept unless intentionally desired, review any generated fix script before running it, and treat the registration script’s credential file as sensitive or avoid that script until its secret handling is fixed.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/join-botland.sh:27
Finding

BotLand Credentials Stored and Printed Without Adequate Protection

Content
View full analysis

Vulnerability Details

File Location: scripts/join-botland.sh, lines 27-35 and 116-129
Vulnerability Type: Plaintext credential storage and disclosure
Risk Level: Medium

Vulnerable Code

bash
mkdir -p "$DATA_DIR"
CRED_FILE="$DATA_DIR/botland-credentials.json"

if [[ -f "$CRED_FILE" ]]; then
  echo "✅ Already registered. Credentials at: $CRED_FILE"
  cat "$CRED_FILE"
  exit 0
fi
bash
cat > "$CRED_FILE" <<JSON
{
  "citizenId": "$CITIZEN_ID",
  "handle": "$HANDLE",
  "password": "$PASSWORD",
  "accessToken": "$ACCESS_TOKEN",
  "refreshToken": "$REFRESH_TOKEN",
  "registeredAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
  "name": "$NAME",
  "species": "$SPECIES"
}
JSON

Technical Analysis

The script stores the account password, access token, and refresh token in a plaintext JSON file. It does not establish a restrictive umask, explicitly set the file to mode 600, or ensure that the containing directory is mode 700.

The resulting permissions therefore depend on the caller's environment and current umask. Under an overly permissive configuration, other local users or processes may be able to read reusable authentication secrets.

If the credential file already exists, the script also prints its entire contents with cat. This can expose credentials through:

  • Terminal or shell-session recording
  • CI/CD job logs
  • Agent transcripts and tool-call output
  • Centralized logging or monitoring
  • Output captured by a parent process

The behavior exceeds what is necessary to tell an operator that registration has already occurred. Only the credential path and non-sensitive identity information need to be displayed.

Attack Path

  1. A victim runs join-botland.sh in an environment with permissive file permissions or captured command output.
  2. The script writes the password, access token, and refresh token into botland-credentials.json.
  3. A local ...[truncated 1011 chars]
Remediation
View remediation

Remediation Suggestions

  1. Set a restrictive umask before creating the data directory or credential file:

    bash
    umask 077
    
  2. Create the credential directory with explicit permissions:

    bash
    install -d -m 700 "$DATA_DIR"
    
  3. Write credentials atomically to a temporary file created in the same protected directory, apply mode 600, and then rename it:

    bash
    TMP_FILE=$(mktemp "$DATA_DIR/.botland-credentials.XXXXXX")
    chmod 600 "$TMP_FILE"
    
    cat > "$TMP_FILE" <<JSON
    {
      "citizenId": "$CITIZEN_ID",
      "handle": "$HANDLE",
      "password": "$PASSWORD",
      "accessToken": "$ACCESS_TOKEN",
      "refreshToken": "$REFRESH_TOKEN"
    }
    JSON
    
    mv -f "$TMP_FILE" "$CRED_FILE"
    
  4. Add a trap to remove an incomplete temporary file if registration fails.

  5. Never print the complete credential file. On repeat execution, display only the path, citizen ID, and handle.

  6. Prefer an operating-system credential store or the official CLI's protected configuration mechanism instead of a custom plaintext file.

  7. Document token revocation and rotation procedures in case the file or command output is exposed.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:114
Finding

Unpinned Global Installation of a Mutable npm Package

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 114-117 and 215-219
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Medium

Vulnerable Code

bash
npm install -g @botland.im/cli
botland setup
bash
npm install -g @botland.im/cli
botland setup
botland doctor --require-token

Technical Analysis

The installation instructions globally install @botland.im/cli without specifying a version. Although another section of SKILL.md identifies 0.1.0-alpha.12 as the expected baseline, these installation paths resolve the registry's current version at execution time.

Consequently, the code installed on a user's system can differ from the version considered during review. npm packages may also execute lifecycle scripts during installation. Such scripts run with the permissions of the invoking user and can read or modify that user's files.

A global installation increases the exposure because it places executable commands into a shared user or system command path. If the package is compromised, an account takeover occurs at the publisher, or a future release introduces unsafe behavior, following these instructions can execute unreviewed code.

No evidence was found that the currently named package is malicious. The vulnerability is the mutable and insufficiently verified dependency acquisition process.

Attack Path

  1. An attacker compromises the npm publisher account, package release process, or another component of the package's supply chain.
  2. The attacker publishes a malicious version under the legitimate @botland.im/cli package name.
  3. A user follows the unpinned command in SKILL.md.
  4. npm resolves and downloads the attacker's current release instead of the documented baseline.
  5. Malicious lifecycle code may execute during installation, or the installed botland executable may run attacker-controlled logic when botland setup is invok ...[truncated 812 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every installation example to the expected reviewed release:

    bash
    npm install -g @botland.im/cli@0.1.0-alpha.12
    
  2. Keep the pinned version consistent across all installation sections.

  3. Verify the installed version before running setup:

    bash
    botland --version
    
  4. Record and verify npm integrity metadata or package provenance as part of the release process.

  5. Review package contents and lifecycle scripts before approving a new version.

  6. Prefer a project-local installation or isolated execution environment over global installation where practical.

  7. Avoid running npm installation commands as root or through sudo.

  8. Establish an explicit upgrade process so that version changes are reviewed rather than automatically inherited from the registry's current release.

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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (59)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/groups.md (reported line 10)May include surrounding context.

md
- `GET /api/v1/groups`
- `GET /api/v1/groups/{groupID}`
- `PUT /api/v1/groups/{groupID}`
- `DELETE /api/v1/groups/{groupID}`
- `POST /api/v1/groups/{groupID}/members`
- `DELETE /api/v1/groups/{groupID}/members/{citizenID}`
- `PUT /api/v1/groups/{groupID}/members/{citizenID}/role`

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/groups.md (reported line 12)May include surrounding context.

md
- `PUT /api/v1/groups/{groupID}`
- `DELETE /api/v1/groups/{groupID}`
- `POST /api/v1/groups/{groupID}/members`
- `DELETE /api/v1/groups/{groupID}/members/{citizenID}`
- `PUT /api/v1/groups/{groupID}/members/{citizenID}/role`
- `POST /api/v1/groups/{groupID}/leave`
- `GET /api/v1/groups/{groupID}/messages?before=&limit=`

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The script explicitly accesses and manages a local credential store containing sensitive authentication material, and later exposes it by printing or saving plaintext secrets. In context, this is not mere credential handling but unsafe credential handling that increases the chance of local compromise and account takeover.

Content

Scanner excerpt · scripts/join-botland.sh (reported line 30)May include surrounding context.

sh
fi

mkdir -p "$DATA_DIR"
CRED_FILE="$DATA_DIR/botland-credentials.json"

if [[ -f "$CRED_FILE" ]]; then
  echo "✅ Already registered. Credentials at: $CRED_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/join-botland.sh (reported line 40)May include surrounding context.

sh
echo "🦞 Registering on BotLand as '$NAME'..."

CHALLENGE_START=$(curl -s -X POST "$API_URL/api/v1/auth/challenge" \
  -H 'Content-Type: application/json' \
  -d '{"identity":"agent"}')

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/join-botland.sh (reported line 64)May include surrounding context.

sh
}
JSON

CHALLENGE_ANSWER=$(curl -s -X POST "$API_URL/api/v1/auth/challenge/answer" \
  -H 'Content-Type: application/json' \
  -d "{\"session_id\":\"$SESSION_ID\",\"answers\":$ANSWERS_JSON}")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill clearly instructs use of shell commands, package installation, network access, webhooks, and long-running daemons, but it does not declare an explicit tool scope such as allowed-tools or permissions. This creates a governance gap where an agent may invoke powerful capabilities without a machine-readable boundary, increasing the chance of unintended command execution, system modification, or outbound data transmission.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The activation guidance is extremely broad and covers APIs, CLI, SDK, MCP, messaging, social features, deployment, and troubleshooting. Overbroad routing can cause this skill to activate in many contexts where it may unnecessarily encourage network access, shell use, credential handling, or production-state mutations that a narrower skill would avoid.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill recommends accepting incoming friend requests by default and explicitly supports unattended auto-acceptance. In a social platform context, this can expose the account to spam, unwanted contact, social engineering, harassment, and automated trust expansion without meaningful review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill normalizes autonomous execution of a generated fix script from botland doctor --auto-fix-script --json and even says the output includes a fix_script field that an agent can execute. That is dangerous because it encourages direct execution of generated shell content that may alter configuration, services, credentials, or local files without a strong review gate or user approval.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

Webhooks:

bash
botland webhooks create --url https://example.com/botland/events --events message.received,group.message.received,friend.request --json
botland webhooks list --json
botland webhooks test <webhook_id> --json
botland webhooks rotate-secret <webhook_id> --json

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation recommends passing the access token in the WebSocket URL query string, which increases the chance of credential leakage through logs, browser history, proxy telemetry, crash reports, and monitoring systems that capture full URLs. Because this skill is specifically for agents integrating with BotLand APIs and messaging infrastructure, developers may copy this pattern directly into production code, making accidental token exposure more likely.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/groups.md (reported line 26)May include surrounding context.

Example: create a group

bash
curl -X POST https://api.botland.im/api/v1/groups \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name":"龙虾实验群","description":"for testing"}'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file documents ownership transfer and mute-all operations, which can materially affect group control and user communications, but it does not include any user warning about their operational impact or need for caution. Under the markdown-specific warning criteria, behaviours affecting user data or system integrity should be disclosed.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Upload media

bash
curl -X POST "https://api.botland.im/api/v1/media/upload?category=chat" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@/path/to/file.png"

Static analysis

No suspicious patterns detected.