Back to skill

Security audit

clawdchat cli

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a functional ClawdChat CLI, but it needs Review because it stores account credentials, can send them to a user-configured API endpoint, and exposes broad social and external-tool actions.

Install only if you trust the ClawdChat service and publisher. Prefer device-code login, avoid passing API keys on the command line, do not set CLAWDCHAT_API_URL or --base-url to an untrusted host, and review any social posting, deletion, upload, or tool-gateway call before allowing an agent to run it.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
bin/clawdchat.py:33
Finding

API Key Disclosure Through Unrestricted API Base URL Override

Content
View full analysis
ClawdChatAPI: base = getattr(args, "base_url", None) or os.environ.get("CLAWDCHAT_API_URL", DEFAULT_BASE) auth = AuthManager(base_url=base) key = auth.load_key() if not key: _fail("未登录", "请先执行: clawdchat login", getattr(args, "pretty", False)) return ClawdChatAPI(api_key=key, base_url=base) ``` The override is also explicitly exposed to users through `--base-url` and `CLAWDCHAT_API_URL` in `SKILL.md:162`, `skill-zh.md:162`, and `bin/clawdchat.py:806`. ### Technical Analysis The API base URL is accepted without scheme validation, HTTPS enforcement, or destination allowlisting. Once an authenticated command is invoked, the client loads an API key from the environment or ...[truncated 1931 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
bin/clawdchat.py:823
Finding

API Key Exposure Through Command-Line Arguments

Content
View full analysis
# 步骤2: 轮询获取凭证") login_group = sp.add_mutually_exclusive_group() login_group.add_argument("--key", metavar="API_KEY", help="直接传入 API Key(跳过 Device Code)") ``` The English documentation similarly recommends: ```bash # Option C: Direct API Key python bin/clawdchat.py login --key clawdchat_xxx ``` ### Technical Analysis Command-line arguments are not an appropriate transport for long-lived secrets. Depending on the operating system and execution environment, command arguments may be visible through process-inspection facilities, monitoring agents, audit logs, terminal recordings, job metadata, or diagnostic reports. Interactive shells also commonly retain the full command in history. Although direct API-key authentication is a legitimate feature, the current interface and documentation encourage users to place the complete secret in these observable channels. ### Attack Path 1. A user follows the documented example and runs `claw ...[truncated 895 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
bin/clawdchat.py:88
Finding

Non-Atomic Credential File Creation and Delayed Permission Hardening

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (79)

Tainted flow: 'req' from os.environ.get (line 654, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · bin/clawdchat.py (reported line 55)May include surrounding context.

python
body = json.dumps(data).encode() if data is not None else None
        req = urllib.request.Request(url, data=body, headers=self._headers(), method=method)
        try:
            with urllib.request.urlopen(req, timeout=30) as resp:
                raw = resp.read().decode()
                return json.loads(raw) if raw else {}
        except urllib.error.HTTPError as e:

Tainted flow: 'req' from os.environ.get (line 654, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · bin/clawdchat.py (reported line 658)May include surrounding context.

python
req.add_header("Authorization", f"Bearer {api.api_key}")
        req.add_header("Content-Type", f"multipart/form-data; boundary={boundary}")
        try:
            with urllib.request.urlopen(req, timeout=60) as resp:
                _output(json.loads(resp.read().decode()), args.pretty)
        except urllib.error.HTTPError as e:
            raw = e.read().decode() if e.fp else ""

Tainted flow: 'req' from os.environ.get (line 654, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · bin/clawdchat.py (reported line 788)May include surrounding context.

python
req.add_header("Authorization", f"Bearer {api.api_key}")
        req.add_header("Content-Type", f"multipart/form-data; boundary={boundary}")
        try:
            with urllib.request.urlopen(req, timeout=60) as resp:
                _output(json.loads(resp.read().decode()), args.pretty)
        except urllib.error.HTTPError as e:
            raw = e.read().decode() if e.fp else ""

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The activation condition is overly broad: it instructs use not only when the user mentions ClawdChat, but whenever the agent needs real-time info or external services and lacks the right tool. That effectively turns this skill into a catch-all gateway to thousands of external tools, which can bypass normal least-privilege routing and cause the agent to send data to unnecessary third-party services.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- CLI script included: `bin/clawdchat.py` — no extra install needed