Back to skill

Security audit

ClawLock-Rank

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its leaderboard-upload purpose, but users should review it because sensitive scan metadata can be retained locally and the upload endpoint can be silently redirected.

Install only if you are comfortable sending a raw device fingerprint, score, nickname, versions, timestamp, evidence hash, and finding titles to the leaderboard service. Before uploading, confirm the resolved destination is the intended HTTPS Worker and remove any leftover clawlock-rank-preview JSON files from the temp directory if you used preview mode.

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

Note
Location
scripts/submit_score.py:115
Finding

Preview Payload Containing Sensitive Host Data Persists in a Temporary File

Content
View full analysis
None: path.parent.mkdir(parents=True, exist_ok=True) path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8") def resolve_output_path(raw_output: str, preview_only: bool) -> Path | None: if raw_output: return Path(raw_output).expanduser().resolve() if not preview_only: return None handle = tempfile.NamedTemporaryFile( prefix="clawlock-rank-preview-", suffix=".json", delete=False, ) handle.close() return Path(handle.name).resolve() ``` ### Technical Analysis When preview mode is used without an explicit output path, the Skill creates a temporary JSON file with `delete=False`. The sanitized payload is subsequently written to this file, but no cleanup mechanism removes it after preview, upload, cancellation, failure, or process termination. The retained payload includes the raw `device_fingerprint`, security score, adapter details, timestamp, evidence hash, and finding titles. Although `NamedTemporaryFile` normally creates the file with restrictive permissions, the file remains accessible to the same account and may be collected by backups, diagnostics, support bundles, or a later process that compromises the user account. This network-independent persistence is not required once the preview-and-upload workflow has completed. ### Attack Path 1. A user runs `submit_score.py --preview-only`. 2. The Skill creates a file such as `/tmp/clawlock-rank-preview-*.json`. 3. The sanitized payload, including the raw device fingerprint and security finding titles, is written to that file. 4. The user cancels the upload, completes it, or abandons the workflow. 5. Because no cleanup routine runs, the file remains on disk. ...[truncated 849 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/upload.py:181
Finding

Sensitive Upload Can Be Redirected to an Untrusted or Plaintext Endpoint

Content
View full analysis
dict[str, Any]: endpoint = f"{api_base}/api/submit" body = json.dumps(payload, ensure_ascii=False).encode("utf-8") http_request = request.Request( endpoint, data=body, headers={ "Content-Type": "application/json; charset=utf-8", "Accept": "application/json", "User-Agent": DEFAULT_USER_AGENT, }, method="POST", ) try: with request.urlopen(http_request, timeout=timeout) as response: raw = response.read().decode("utf-8") parsed = json.loads(raw) if raw else {} return {"ok": response.status < 400, "body": parsed} except error.HTTPError as exc: raw = exc.read().decode("utf-8", errors="replace") parsed = try_parse_json(raw) return {"ok": False, "body": parsed or {"ok": False, "error": raw or f"HTTP {exc.code}"}} except error.URLError as exc: raise SystemExit(f"Upload failed: {exc.reason}") from exc ``` ```python def normalize_api_base(value: str) -> str: return value.strip().rstrip("/") def resolve_api_base(explicit: str) -> str: for candidate in (explicit, os.environ.get("CLAWLOCK_RANK_API_BASE", ""), read_skill_api_base()): normalized = normalize_api_base(candidate) if normalized: return normalized return "" ``` ### Technical Analysis The uploader accepts its destination from the `--api-base` argument, the `CLAWLOCK_RANK_API_BASE` environment variable, or `config.json`. The selected value is only stripped of whitespace and trailing slashes. The code does not: - Require HTTPS - Restrict the hostname to the declared leaderboard Worker - Reject URL c ...[truncated 2675 chars]
Remediation
View remediation
Vulnerability Patterns
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · SKILL_EN.md (reported line 94)May include surrounding context.

md
- the full raw scan report
- `scan_history.json`

Device fingerprint rules:
- the raw `device_fingerprint` is only sent to the leaderboard Worker
- the Worker salts and hashes it before storage
- the frontend never shows the raw device fingerprint

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes local Python scripts and describes behavior that requires shell execution, file access, environment access, and network upload, but it declares no explicit tool scope or permissions. In an agent environment, this can lead to over-broad implicit privileges, making it easier for the skill to access sensitive local data or perform unintended network actions beyond the narrowly intended upload flow.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/run_scan.py (reported line 88)May include surrounding context.

python
command.extend(args.scan_arg)

    try:
        result = subprocess.run(
            command,
            capture_output=True,
            text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/run_scan.py (reported line 264)May include surrounding context.

python
for command in ([executable, "--version"], [executable, "version"]):
        try:
            result = subprocess.run(
                command,
                capture_output=True,
                text=True,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

In preview mode, the script still persists the sanitized payload to a temporary file even though the interface presents preview as a non-upload, print-oriented action. That creates an unexpected local data-retention side effect: scan-derived metadata remains on disk and can be accessed later by other local users, tools, or logs, which is especially relevant in a security-scanning skill handling potentially sensitive assessment results.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code creates parent directories and writes a JSON payload to disk, which is a file-modifying operation. Although the CLI argument names imply output behavior, there is no confirmation prompt, warning message before the write, or inline disclosure near the write operation itself.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The preview result instructs callers to 'call upload.py with --input <payload_path> --nickname --yes', while this script's own documentation presents it as the tool that runs the scan, previews the payload, and optionally submits it. That embedded guidance points users to a different execution path than the one this script advertises, creating intent/documentation divergence.

Content

No source excerpt is available for this finding.