Back to skill

Security audit

ClawMart 我的AI店铺

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent ClawMart store-management helper, but it stores bearer tokens insecurely and can perform business-impacting actions without enough user confirmation.

Install only if you trust the ClawMart API endpoint and are comfortable letting the agent manage seller account state, products, notes, photos, and bookings. Before use, avoid saving tokens in /tmp, confirm the API host before login or uploads, and require explicit confirmation before seller conversion, updates, deletes, or booking-status 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
SKILL.md:62
Finding

Bearer Token Stored in a Predictable Shared Temporary File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 62–63 and 111–112
Vulnerability Type: Insecure storage of authentication credentials in a shared temporary directory
Risk Level: Medium

Vulnerable Code

Registration flow:

bash
TOKEN="TOKEN_VALUE_FROM_RESPONSE"
echo -n "$TOKEN" > /tmp/clawmart_token.txt

Login flow:

bash
echo -n "TOKEN_VALUE" > /tmp/clawmart_token.txt
TOKEN=$(cat /tmp/clawmart_token.txt)

Technical Analysis

The Skill instructs the agent to store a reusable ClawMart bearer token as plaintext at the fixed path /tmp/clawmart_token.txt. It does not set restrictive permissions, securely create the file, verify file ownership, reject symbolic links, or remove the token after the requested operation is complete.

A predictable file in a shared temporary directory creates several security risks:

  • Another local process or user may read the token if the process umask permits overly broad file permissions.
  • A pre-existing file or symbolic link at this path may redirect or interfere with the write, subject to operating-system protections and the privileges of the process.
  • Concurrent Skill executions can overwrite or consume one another's tokens, potentially causing cross-account operations.
  • The token can remain on disk after the session, extending its exposure beyond the period required for the task.
  • File contents may be captured by host backups, diagnostics, or forensic collection.

The network transmission of credentials, bearer tokens, profile information, and user-selected images to the configured ClawMart API is consistent with the declared store-management functionality and uses HTTPS by default. The confirmed issue is the unnecessary persistence of the bearer token in an insecure shared location, rather than the API communication itself.

Attack Path

  1. An attacker with local access monitors the predictable path /tmp/clawmart_token.txt or ...[truncated 1315 chars]
Remediation
View remediation

Remediation Suggestions

  1. Keep the bearer token only in process memory for the duration of the requested operation. Avoid writing it to disk when persistence is not essential.

  2. If temporary persistence is unavoidable, use a private per-user runtime directory such as $XDG_RUNTIME_DIR, rather than a fixed path in /tmp.

  3. Create token files atomically with permissions restricted to the current user:

    bash
    TOKEN_FILE="$(mktemp "${XDG_RUNTIME_DIR:-$HOME/.cache}/clawmart-token.XXXXXX")"
    chmod 600 "$TOKEN_FILE"
    printf '%s' "$TOKEN" > "$TOKEN_FILE"
    
  4. Ensure the parent directory is owned by the current user and has permissions no broader than 0700.

  5. Reject symbolic links and verify file ownership and permissions before reading an existing token file.

  6. Use a unique token file for each invocation to prevent cross-session and cross-account collisions.

  7. Register cleanup logic and delete the token immediately after use:

    bash
    trap 'rm -f -- "$TOKEN_FILE"' EXIT INT TERM
    
  8. Prefer an operating-system credential store or secret-management service if tokens must persist across sessions.

  9. Revoke exposed tokens and require re-authentication when token-file integrity or confidentiality cannot be established.

  10. Require explicit user confirmation and HTTPS validation before sending credentials, tokens, or files to a user-supplied self-hosted API endpoint.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger guidance is extremely broad and can activate on generic phrases like 'my store' or 'register', increasing the chance the agent invokes this skill for unrelated requests. In context, that can lead to unnecessary authentication prompts, credential collection, or accidental execution of store-management actions against an external API.

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 · evals/evals.json (reported line 11)May include surrounding context.

json
"assertions": [
        {
          "name": "reads_api_url_from_env",
          "description": "从 frontend/.env.local 读取 NEXT_PUBLIC_API_URL 而不是硬编码端口"
        },
        {
          "name": "uses_username_not_email",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs users to transmit credentials to an external service and later store bearer tokens locally in /tmp without any privacy or handling warning. Bearer tokens in a world-readable or weakly protected temporary location can be stolen by other local users/processes, leading to full account compromise and unauthorized store actions.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This registration call sends user-supplied credentials to an external endpoint, which is inherently security-sensitive. In context it is expected functionality, but it still constitutes real external transmission of secrets and creates risk if users are not clearly informed or if the endpoint is untrusted/self-hosted.

Content

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

Then register:

bash
curl -s -X POST "$API/register" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
82% confidence
Finding

This sends an authorization bearer token to an external API to elevate the account into seller mode and then proceeds with store setup. While this is core functionality, misuse of the token or sending it to an attacker-controlled self-hosted URL could enable unauthorized account modification.

Content

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

TOKEN="TOKEN_VALUE_FROM_RESPONSE" echo -n "$TOKEN" > /tmp/clawmart_token.txt

curl -s -X POST "$API/become-seller"
-H "Authorization: Bearer $TOKEN"
-H "Accept: application/json"

text

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

The instructions prescribe a fixed Chinese prompt and confirmation message for the registration flow, without stating that the user can choose another language. This can violate language/locale policy when a specific language is imposed without opt-in or documented justification.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
82% confidence
Finding

This call transmits a bearer token to perform a privilege-changing seller conversion. The action is legitimate, but because it changes account state, accidental execution or use against an untrusted endpoint can have security and privacy consequences.

Content

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

The user must have is_seller: true. If is_seller is false, call:

bash
curl -s -X POST "$API/become-seller" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

These product-management calls transmit authenticated business data to an external service. This is expected for the skill's purpose, but it remains a true data-transmission risk because mistaken triggering or untrusted endpoint configuration could expose inventory information or cause unwanted store changes.

Content

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

List products

bash
curl -s "$API/my-store/products" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill documents product deletion with no explicit warning or confirmation requirement before issuing a destructive API call. If the skill is triggered mistakenly or the wrong product ID is supplied, inventory data can be irreversibly removed from the user's store.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

These note-management API calls send authenticated store communications to an external system. The transmission is intentional, but if the skill is invoked unintentionally or pointed at an attacker-controlled API, business information can be exposed or manipulated.

Content

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

List notes

bash
curl -s "$API/my-store/notes" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Note deletion is a destructive operation, yet the instructions provide no safeguard such as previewing the targeted note or asking for confirmation. This raises the risk of accidental loss of announcements, promotions, or operational notices.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

Photo uploads transmit local files to an external service, which is a meaningful exfiltration boundary. In this context uploads are expected, but the risk is elevated because the skill allows self-hosted API URLs and does not instruct the user to verify the destination before sending images.

Content

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

bash
# Upload store gallery photo
curl -s -X POST "$API/my-store/photos" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -F "image=@/path/to/photo.jpg" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Photo deletion is irreversible and may affect storefront presentation, but the skill offers no warning or confirmation workflow. In a store-management context, accidental media removal can damage listings and business operations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes store management tasks as authentication, store profile, products, notes/announcements, and photo uploads, and the body summary repeats that scope. However, the file also includes endpoints to list and update store bookings, which is a distinct operational area not mentioned in the declared skill description or documentation summary.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

Booking-management requests transmit authenticated operational data to an external API. That is expected functionality, but because this capability is optional and undocumented in the overview, users may be less aware that booking data can be accessed or changed through this skill.

Content

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

bash
# List bookings (optional ?status=pending|confirmed|completed|cancelled)
curl -s "$API/my-store/bookings?status=pending" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This JSON file contains natural-language prompts and expected behavior entirely in Chinese, including explicit task instructions and confirmations. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The second eval prompt and expected output are written solely in Chinese and define the expected interaction in that language. Because the file does not indicate that the skill is region-specific or that users can choose a language, this appears to enforce a locale/language preference without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This eval case continues the pattern of specifying the task and expected behavior only in Chinese. In the absence of a documented regional/compliance reason or an opt-in language setting, this is a natural-language policy violation per the language/locale rule.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.