Back to skill

Security audit

ClawFight

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a genuine online pet game skill, but it needs Review because it runs an unpinned external npm command and can be automated through heartbeat despite under-scoped permission claims.

Review the npm package before installing, prefer a pinned command such as an audited exact version, and avoid enabling HEARTBEAT.md automation unless you are comfortable with recurring execution. Expect local game files under memory/clawfight/ and online requests to api.clawfight.online that send gameplay identifiers and state.

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

T08 · Insecure Dependencies

Error
Location
README.md:37
Finding

Unpinned npm Package Is Retrieved and Executed Through npx

Content
View full analysis

Vulnerability Details

File Location: README.md:37-42; also referenced throughout SKILL.md:20-25, SKILL.md:51-66, and SKILL.md:103-108
Vulnerability Type: T08: Insecure Dependencies
Risk Level: High

Vulnerable Code

markdown
## Requirements

- Node.js (for `npx` command)
- npm package: `@2025-6-19/clawfight`

The skill directory contains only Markdown and JSON reference files.
All game logic runs via `npx @2025-6-19/clawfight`, an open-source npm package
([source code](https://github.com/2019-02-18/clawfight/tree/main/packages/cli)).

The Skill metadata and command documentation similarly identify the package without an exact version:

yaml
requires:
  bins: ["node", "npx"]
version: "1.5.0"
repository: "https://github.com/2019-02-18/clawfight"
npm_package: "@2025-6-19/clawfight"

Technical Analysis

The Skill delegates all executable game logic to @2025-6-19/clawfight and instructs the Agent to invoke it through npx without an exact package version, lockfile, integrity hash, or locally audited implementation.

When the package is not already installed, npx can retrieve the version currently selected by the npm registry and execute its entry point. Consequently, the code executed at runtime may differ from the code that existed when this Markdown-only Skill was reviewed. Links to a public source repository and statements asserting that published builds match the repository do not cryptographically establish that the downloaded npm artifact matches an audited revision.

The supplied project does not include the npm package source, package lock data, checksums, or provenance records. Therefore, the executable behavior—including filesystem access, environment-variable access, subprocess execution, and network transmission—cannot be verified from the audited artifact.

Optional heartbeat integration increases exposure by allowing the external package to run repeatedly ...[truncated 1795 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin every invocation to a specific, reviewed package version, for example @2025-6-19/clawfight@1.5.0, rather than relying on the registry-selected release.
  2. Commit a lockfile containing the resolved version and integrity metadata, and install dependencies through a controlled installation step.
  3. Prefer npx --no-install after explicitly installing and verifying the approved package. This prevents runtime retrieval of an unexpected release.
  4. Vendor the executable CLI source into the reviewed project, or include the exact source revision and build artifacts needed for a complete audit.
  5. Verify npm provenance, publisher identity, signatures, and package integrity before installation. Compare the downloaded artifact against reproducible builds from an approved repository commit.
  6. Run the CLI under a least-privilege account or sandbox with filesystem and network access restricted to the documented game-state directory and API domain.
  7. Require explicit user approval before enabling heartbeat automation. Do not activate recurring execution until the dependency has been pinned and verified.
  8. Add automated dependency monitoring and alert on publisher changes, provenance failures, integrity changes, unexpected lifecycle scripts, or newly introduced network destinations.
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (17)

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## Security & Privacy / 安全与隐私

### Data Scope / 数据范围
- **No system file access / 不访问系统文件** — Does not read SSH keys, browser data, credentials, or any files outside `memory/clawfight/` / 不读取 SSH 密钥、浏览器数据、凭证或 memory/clawfight/ 以外的任何文件
- **No PII collection / 不采集个人信息** — Only uploads: lobster UUID, level (integer), stats SHA256 hash, battle results / 仅上传:龙虾UUID、等级(整数)、属性SHA256哈希、战斗结果
- **Local-only storage / 纯本地存储** — All game data stored in `memory/clawfight/` (lobster.json, soul.md, log.md) / 所有游戏数据存储在本地

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes broad generic terms like 'pet', 'battle', 'idle', and 'leaderboard', which can cause unintended invocation in unrelated conversations. Accidental activation is risky here because the skill can run npx commands, modify local state, and perform network requests without a narrowly scoped user intent signal.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

While the document lists external endpoints later, it does not present a clear up-front warning in the user-facing description that commands may contact api.clawfight.online and transmit gameplay identifiers and state. Users may reasonably treat this as a local idle pet skill and not realize online actions occur during normal gameplay such as patrol or dungeon operations.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

This endpoint indicates external transmission to a third-party service for patrol check-ins. Network access itself is expected for an online game, but it still expands the attack surface and creates privacy/integrity risk if users are not clearly warned and the endpoint is not independently validated.

Content

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

md
| Endpoint | Method | Purpose / 用途 |
|---|---|---|
| `https://api.clawfight.online/api/patrol` | POST | Patrol check-in & encounter trigger / 巡逻签到 |
| `https://api.clawfight.online/api/encounter` | GET | Get opponent info / 获取对手信息 |
| `https://api.clawfight.online/api/result` | POST | Report battle result / 上报战斗结果 |
| `https://api.clawfight.online/api/leaderboard` | GET | Leaderboard data / 排行榜数据 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The skill defines another external endpoint for opponent info retrieval, confirming routine third-party network interaction. In context this is likely functional rather than malicious, but it remains security-relevant because remote responses can influence local behavior and expose gameplay metadata.

Content

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

md
| Endpoint | Method | Purpose / 用途 |
|---|---|---|
| `https://api.clawfight.online/api/patrol` | POST | Patrol check-in & encounter trigger / 巡逻签到 |
| `https://api.clawfight.online/api/encounter` | GET | Get opponent info / 获取对手信息 |
| `https://api.clawfight.online/api/result` | POST | Report battle result / 上报战斗结果 |
| `https://api.clawfight.online/api/leaderboard` | GET | Leaderboard data / 排行榜数据 |
| `https://api.clawfight.online/api/dungeon/enter` | POST | Enter dungeon / 进入地下城 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

Reporting battle results to an external service is a genuine external transmission path. Even if only game data is sent, users should be informed because identifiers and gameplay outcomes leave the local environment and may be correlated server-side.

Content

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

md
|---|---|---|
| `https://api.clawfight.online/api/patrol` | POST | Patrol check-in & encounter trigger / 巡逻签到 |
| `https://api.clawfight.online/api/encounter` | GET | Get opponent info / 获取对手信息 |
| `https://api.clawfight.online/api/result` | POST | Report battle result / 上报战斗结果 |
| `https://api.clawfight.online/api/leaderboard` | GET | Leaderboard data / 排行榜数据 |
| `https://api.clawfight.online/api/dungeon/enter` | POST | Enter dungeon / 进入地下城 |
| `https://api.clawfight.online/api/dungeon/act` | POST | Make dungeon choice / 地下城选择 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

Leaderboard retrieval is external network activity and should be treated as such. Although lower risk than POSTing state, it still establishes a remote dependency and can leak metadata such as IP/user agent at the transport layer.

Content

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

md
| `https://api.clawfight.online/api/patrol` | POST | Patrol check-in & encounter trigger / 巡逻签到 |
| `https://api.clawfight.online/api/encounter` | GET | Get opponent info / 获取对手信息 |
| `https://api.clawfight.online/api/result` | POST | Report battle result / 上报战斗结果 |
| `https://api.clawfight.online/api/leaderboard` | GET | Leaderboard data / 排行榜数据 |
| `https://api.clawfight.online/api/dungeon/enter` | POST | Enter dungeon / 进入地下城 |
| `https://api.clawfight.online/api/dungeon/act` | POST | Make dungeon choice / 地下城选择 |
| `https://api.clawfight.online/api/dungeon/state` | GET | Resume dungeon state / 恢复地下城状态 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
85% confidence
Finding

Dungeon entry uses an external API, making gameplay dependent on a remote service and transmitting state beyond local storage. In context this appears to support advertised functionality, but it is still a true security concern due to data exposure and trust in remote responses.

Content

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

md
| `https://api.clawfight.online/api/encounter` | GET | Get opponent info / 获取对手信息 |
| `https://api.clawfight.online/api/result` | POST | Report battle result / 上报战斗结果 |
| `https://api.clawfight.online/api/leaderboard` | GET | Leaderboard data / 排行榜数据 |
| `https://api.clawfight.online/api/dungeon/enter` | POST | Enter dungeon / 进入地下城 |
| `https://api.clawfight.online/api/dungeon/act` | POST | Make dungeon choice / 地下城选择 |
| `https://api.clawfight.online/api/dungeon/state` | GET | Resume dungeon state / 恢复地下城状态 |
| `https://api.clawfight.online/api/dungeon/abandon` | POST | Abandon dungeon / 放弃地下城 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
85% confidence
Finding

Dungeon actions are POSTed externally, which is a real outbound data flow. This is not inherently malicious in a multiplayer/online game context, but it does create privacy and integrity risks if not surfaced prominently to users.

Content

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

md
| `https://api.clawfight.online/api/result` | POST | Report battle result / 上报战斗结果 |
| `https://api.clawfight.online/api/leaderboard` | GET | Leaderboard data / 排行榜数据 |
| `https://api.clawfight.online/api/dungeon/enter` | POST | Enter dungeon / 进入地下城 |
| `https://api.clawfight.online/api/dungeon/act` | POST | Make dungeon choice / 地下城选择 |
| `https://api.clawfight.online/api/dungeon/state` | GET | Resume dungeon state / 恢复地下城状态 |
| `https://api.clawfight.online/api/dungeon/abandon` | POST | Abandon dungeon / 放弃地下城 |

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

Resuming dungeon state via GET is another external dependency. This is less severe than mutating endpoints but still relevant because it ties the local skill to remote state and may reveal identifiers or session-like metadata.

Content

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

md
| `https://api.clawfight.online/api/leaderboard` | GET | Leaderboard data / 排行榜数据 |
| `https://api.clawfight.online/api/dungeon/enter` | POST | Enter dungeon / 进入地下城 |
| `https://api.clawfight.online/api/dungeon/act` | POST | Make dungeon choice / 地下城选择 |
| `https://api.clawfight.online/api/dungeon/state` | GET | Resume dungeon state / 恢复地下城状态 |
| `https://api.clawfight.online/api/dungeon/abandon` | POST | Abandon dungeon / 放弃地下城 |

## Security & Privacy / 安全与隐私

External Transmission

Medium
Category
Data Exfiltration
Confidence
85% confidence
Finding

Abandoning a dungeon posts data to the external service, confirming that even state transitions are remotely tracked. In this game context the intent looks benign, but the security impact remains non-zero because external service compromise or misuse affects player data and behavior.

Content

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

md
| `https://api.clawfight.online/api/dungeon/enter` | POST | Enter dungeon / 进入地下城 |
| `https://api.clawfight.online/api/dungeon/act` | POST | Make dungeon choice / 地下城选择 |
| `https://api.clawfight.online/api/dungeon/state` | GET | Resume dungeon state / 恢复地下城状态 |
| `https://api.clawfight.online/api/dungeon/abandon` | POST | Abandon dungeon / 放弃地下城 |

## Security & Privacy / 安全与隐私

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document asserts no access outside memory/clawfight/, yet separately instructs modifying HEARTBEAT.md, which is outside that directory. Even if limited in scope, this contradiction weakens trust boundaries and can mislead reviewers about the true filesystem footprint of the skill.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill labels HEARTBEAT integration as 'read-only', but elsewhere defines patrol as state-changing and networked: it updates local files, changes EXP/depth, may trigger battles, and performs API check-ins. This is a misleading security claim that can cause users or orchestrators to grant or schedule the command under a weaker trust model than warranted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document title and core instructions are entirely in Chinese, which effectively constrains the skill's operating language for agent interpretation and likely downstream narration. Under the policy, forcing a specific language without user opt-in or a documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This JSON file defines all user-facing prompt templates and selection-method text in Chinese only. Because the file provides no indication of user opt-in, language fallback, or region-specific justification, it appears to enforce a specific language/locale in a way that conflicts with the policy for natural-language handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JSON includes many natural-language values such as labels, descriptions, and name components exclusively in Chinese. Because SQP-3 applies to all file types, this is a language/locale policy concern when the skill forces a specific language without offering user opt-in or documenting a justified region-specific scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file explicitly instructs the agent to write generated personality data into memory/clawfight/soul.md and later append updates to that memory file. Even though this is core game functionality, it causes persistent state changes without any user-facing disclosure, consent boundary, or retention guidance, which can surprise users and create unwanted stored data over time.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.