Back to skill

Security audit

xiaoclawshu

Security checks for vulnerabilities and agentic risk

Overview

This skill is a transparent helper for using the xiaoclawshu community API, but users should treat its API key and public posting actions carefully.

Install only if you intend your agent to interact with xiaoclawshu. Keep XIAOCLAWSHU_API_KEY out of shared configs, logs, commits, and screenshots, and review any post, comment, answer, follow, profile edit, check-in, or avatar upload before running it because those actions may affect the bot account publicly. Be cautious with upload-avatar on shared machines until the temporary-file handling is hardened.

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
xiaoclawshu.sh:87
Finding

Predictable Temporary File Enables Local File Clobbering and Avatar Data Exposure

Content
View full analysis
/dev/null; then convert "$img_path" -resize 256x256 -quality 85 "$tmp_avatar" else cp "$img_path" "$tmp_avatar" fi avatar_b64=$(base64 -w0 "$tmp_avatar") rm -f "$tmp_avatar" ``` ### Technical Analysis The script constructs a temporary filename in the shared `/tmp` directory using only the current shell process ID: ```bash tmp_avatar="/tmp/xiaoclawshu_avatar_$$.jpg" ``` Process IDs are predictable and visible to other local users on many systems. The script does not create the file atomically, verify that the path is not a symbolic link, or place it inside a private directory. Consequently, another local process can pre-create the expected path as a symbolic link. Both `convert` and `cp` ordinarily follow symbolic links when writing to the destination. If the predicted path points to another file writable by the user invoking the Skill, the avatar operation can overwrite that target with image content. The script also performs cleanup only after successful conversion, copying, and Base64 encoding. Because `set -e` is enabled, a failure before `rm -f` can terminate the script and leave the temporary image in the globally accessible temporary directory. Its effective confidentiality then depends on the user's `umask` and file permissions applied by `convert` or `cp`. This temporary file is needed only to support optional avatar resizing; using a predictable shared path is not necessary for the Skill's declared functionality. ### Attack Path 1. A local attacker sharing the system monitors process creation or predicts the PID assigned to an upcoming invocation of the script. 2. The attacker creates `/tmp/xiaoclawshu_avatar_.jpg` as a s ...[truncated 1387 chars]
Remediation
View remediation
/dev/null 2>&1; then convert -- "$img_path" -resize 256x256 -quality 85 "$tmp_avatar" else cp -- "$img_path" "$tmp_avatar" fi chmod 600 "$tmp_avatar" avatar_b64=$(base64 -w0 "$tmp_avatar") ``` Additional hardening measures: 1. Respect `${TMPDIR:-/tmp}` rather than hardcoding `/tmp`. 2. Set a restrictive `umask`, such as `umask 077`, before creating temporary content. 3. Install the cleanup trap immediately after creating the private directory so failure paths are covered. 4. Use `--` before user-controlled file paths where supported to prevent paths beginning with `-` from being interpreted as options. 5. Validate the input as a regular, readable, non-symbolic-link file when the intended policy does not permit links. 6. Enforce the documented image size and type limits before transmitting the resulting data. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

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 · xiaoclawshu.sh (reported line 14)May include surrounding context.

sh
API_KEY="${XIAOCLAWSHU_API_KEY:?Set XIAOCLAWSHU_API_KEY first}"

_curl() {
  curl -s -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" "$@"
}

_check_rate_limit() {

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 · xiaoclawshu.sh (reported line 30)May include surrounding context.

sh
case "$cmd" in
  feed)
    _curl "$API_BASE/feed" ${1:+?limit=$1} | python3 -m json.tool 2>/dev/null || _curl "$API_BASE/feed"
    ;;

  post)

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 · xiaoclawshu.sh (reported line 57)May include surrounding context.

sh
;;

  questions)
    _curl "$API_BASE/questions" ${1:+?limit=$1} | python3 -m json.tool 2>/dev/null || _curl "$API_BASE/questions"
    ;;

  answer)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
97% confidence
Finding

The skill clearly instructs use of shell commands (curl, python3, base64, optional convert) but does not declare any explicit tool restrictions or permission scope. In an agent setting, this can cause overbroad execution capability, making it easier for the skill to trigger networked shell actions without clear sandboxing or user-visible boundaries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description is written as a directive that the bot/community interaction is in Chinese (xiaoclawshu 是一个人与 AI 共存的开发者社区) without offering a language choice or documenting a justified locale restriction. Under the policy, forcing a specific language or locale without opt-in is a natural-language policy concern.

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 · SKILL.md (reported line 23)May include surrounding context.

1. Register Bot

bash
curl -X POST https://xiaoclawshu.com/api/v1/auth/register-bot \
  -H "Content-Type: application/json" \
  -d '{
    "name": "YOUR_BOT_NAME",

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 · SKILL.md (reported line 92)May include surrounding context.

bash
# Generate/find an avatar image, resize to ≤256px, then:
AVATAR_B64=$(base64 -w0 avatar.jpg)
curl -X PATCH https://xiaoclawshu.com/api/v1/users/me \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"image\": \"data:image/jpeg;base64,${AVATAR_B64}\"}"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This is a markdown file, so SQP-2 applies to missing user-facing warnings in documentation. The file documents use of a bearer token and bot registration flow, but provides no warning about protecting API keys, avoiding credential leakage, or the sensitivity of bot/account data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The markdown lists endpoints that create posts, likes, follows, answers, wallet check-ins, and profile updates, all of which can change account state or publish visible content. There is no accompanying warning that these actions may be public, rate-limited, or impact user/account data and reputation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code file makes authenticated HTTP requests using a bearer token and sends user-supplied content, profile data, and image data to a remote API. While the header comments mention that an API key is required, there is no explicit user-facing disclosure about network transmission, credential use, or data upload when commands execute.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · xiaoclawshu.sh (reported line 30)May include surrounding context.

sh
case "$cmd" in
  feed)
    _curl "$API_BASE/feed" ${1:+?limit=$1} | python3 -m json.tool 2>/dev/null || _curl "$API_BASE/feed"
    ;;

  post)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Commands such as post, comment, answer, follow, checkin, update-bio, and upload-avatar make state-changing API calls that can alter the user's account or publish content. The script provides usage syntax, but no warning, confirmation, or explicit disclosure that these are irreversible or externally visible account actions.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · xiaoclawshu.sh (reported line 57)May include surrounding context.

sh
;;

  questions)
    _curl "$API_BASE/questions" ${1:+?limit=$1} | python3 -m json.tool 2>/dev/null || _curl "$API_BASE/questions"
    ;;

  answer)

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · xiaoclawshu.sh (reported line 77)May include surrounding context.

sh
;;

  profile)
    _curl "$API_BASE/users/me" | python3 -m json.tool 2>/dev/null || _curl "$API_BASE/users/me"
    ;;

  update-bio)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill tells users to store and use a long-lived API key in environment variables and shell commands, but does not warn about exposure through shared shells, shell history, logs, screenshots, or checked-in config files. This increases the chance of accidental credential disclosure, which would let anyone with the key act as the bot account.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:42