T07 · Tool Hijacking and Spoofing
- Location
scripts/push_to_ima.py:136- Finding
Automatic IMA CLI Fallback Permits PATH-Based Tool Spoofing
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its daily ClawHub reporting purpose, but its automatic IMA behavior can send reports to a built-in knowledge-base ID and can fall back to running locally resolved CLI commands without a separate confirmation.
Install only if you are comfortable with scheduled network fetching and report pushes. Before enabling IMA, set your own kb_id, prefer --mode official, and avoid auto CLI fallback unless you trust the exact executable path. Use --skip-push, --skip-ima, or missing credentials for local-only operation.
scripts/push_to_ima.py:136Automatic IMA CLI Fallback Permits PATH-Based Tool Spoofing
scripts/push_to_ima.py:32Hard-Coded IMA Knowledge-Base Identifier Can Route Reports to an Unconfirmed Destination
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"msg_type": "interactive",
"content": json.dumps(card)
}
resp = requests.post(
"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id",
headers=headers, json=msg, timeout=20
)
声明将该技能描述为一个端到端的“每日扫描 + 多渠道推送”系统,但给出的代码块只是其中的推荐生成子步骤。它从本地 metrics 文件读取 Skill 数据,执行 6 维度推荐、7 天去重、痛点匹配、中文一句话生成、Markdown/飞书 blocks 输出,并保存到本地 JSON/Markdown。代码行为与声明中的推荐算法、降级策略、optional verified 维度、中文简报等内容大体一致;但声明强调的核心能力还包括实时抓取 ClawHub API、按凭证向飞书/IMA/Obsidian 推送、读取环境变量/config 凭证、以及可能调用 ima-skill CLI,这些在该代码块中完全不存在。因此若将“技能描述”视为对所提供代码块本身的准确表述,则存在明显夸大/不匹配:代码只覆盖本地推荐生成,不覆盖声明中的扫描与多渠道分发能力。
The code matches only one narrow subset of the description: accessing the ClawHub Convex API and writing local files. Its actual purpose is a data collection script (fetch_clawhub.py) that retrieves paginated public skill records and stores them as a snapshot JSON. The declared description, however, presents a much broader end-to-end recommendation and distribution system, including ranking logic, deduplication across days and dimensions, Chinese report generation, and multiple outbound integrations (Feishu, IMA, Obsidian, local Markdown). None of those core behaviors are present in this code chunk. There is no evidence of undeclared harmful behavior, but there is a strong description-versus-behavior mismatch because the primary declared functionality is absent from the supplied code.
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# 贡献指南(Contributing)
欢迎为 **clawhub-daily** 贡献代码、文档、痛点配置或 Bug 反馈!
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
将 GH_TOKEN 保存到 .env.local(不入库):
echo "GH_TOKEN=ghp_xxxxxxxxxxxxx" > .env.local
确保 .gitignore 包含 .env.local(默认已包含)。
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
trending/quality/newcomers/panorama)\n3. 痛点匹配 + 10 天去重\n4. 生成简报 + 飞书推送\n\n# 输出\n简报 Markdown + 飞书卡片(200-400 字)" }, "delivery": { "mode": "announce", "channel": "feishu" } }
---
## 🎯 模板 3:纯 Linux/Mac crontab
**频率**:每 2 天 1 次(北京时间 21:00)
**特点**:完全独立,无 Agent 依赖
```cron
# 编辑 crontab
0 13 */2 * * /bin/bash -c 'cd <your_clawhub_daily_path> && python clawhub_daily_executor.py >> logs/cron.log 2>&1'
<your_clawhub_daily_path> 替换为实际路径(如 ~/projects/clawhub-daily)。
建议:
logs/ 目录用于 cron 日志>> 追加而非 > 覆盖2>&1 重定向错误输出频率:每 2 天 1 次(北京时间 21:00)
步骤:
Broad trigger phrases like generic daily-report prompts can cause accidental invocation in normal conversation or scheduling contexts. Because this skill performs network access and may push content to external services or local vaults, unintended activation increases the chance of unreviewed data collection and data egress.
Without declared permissions the skill's intent is opaque and cannot be validated.
The markdown explicitly states '简报中文化:中文一句话 + 英文原文' and elsewhere reiterates that the output language is primarily Chinese. This is a natural-language locale policy constraint presented as a default behavior, but the file does not offer users a language selection or opt-in mechanism.
The limitations section states '语言:中文为主' with English only folded as secondary content. Because this file is user-facing documentation, specifying a fixed primary language without presenting a choice can violate the language/locale policy criteria.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f"{'='*60}")
start = time.time()
try:
result = subprocess.run(
cmd,
cwd=cwd or str(PROJECT_ROOT),
capture_output=False,
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.github.com/user/repos \
-H "Authorization: token <GH_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name": "clawhub-daily", "private": false, "auto_init": true}'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.github.com/user/repos \
-H "Authorization: token <GH_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name": "clawhub-daily", "private": false, "auto_init": true}'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.github.com/user/repos \
-H "Authorization: token <GH_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name": "clawhub-daily", "private": false, "auto_init": true}'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.github.com/user/repos \
-H "Authorization: token <GH_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name": "clawhub-daily", "private": false, "auto_init": true}'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
upload_file() {
local file_path="$1"
local content=$(base64 -w 0 "$file_path" 2>/dev/null || base64 "$file_path")
curl -X PUT "https://api.github.com/repos/EdwardWason/clawhub-daily/contents/$file_path" \
-H "Authorization: token <GH_TOKEN>" \
-H "Content-Type: application/json" \
-d "{\"message\": \"Upload $file_path\", \"content\": \"$content\", \"branch\": \"main\"}"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
cursor = None
for i in range(0, num_target, page_size):
resp = requests.post(
"https://wry-manatee-359.convex.cloud/api/query",
json={
"path": "skills:listPublicPageV4",
This markdown template is entirely written to generate Chinese-language briefings and message cards, including headings, body copy, and UI text. The file does not offer an alternative locale or note that Chinese is optional, which can violate a language/locale policy when the skill is expected to adapt to user preferences.
This markdown explicitly defines a dedicated '中文支持 (Chinese Support)' scenario and its action templates instruct use in existing Chinese workflows, but it does not state that language selection is optional or user-driven. Under the policy, forcing or presuming a specific language/locale without opt-in can be a natural-language policy violation.
Multiple task templates instruct '10 天去重' while the manifest consistently declares '7 天跨维度去重' as a core behavior. This is an active contradiction in user-facing operational guidance that can cause the skill to be invoked with behavior outside its documented intent.
The Hermes example repeats '10 天去重', which directly conflicts with the manifest's stated 7-day deduplication behavior. Because this is an execution template, it materially changes the intended operation users will trigger.
This markdown file contains natural-language instructions exclusively in Chinese, including all setup, warnings, and usage guidance. Under the policy rule for language or locale constraints, forcing a specific language without user opt-in is a reportable issue unless the locale limitation is explicitly justified, which is not present here.
This Python file uses Chinese-only natural-language strings in the module docstring, function docstrings, argparse descriptions, and console output. The policy allows locale constraints only when the skill offers user choice or clearly documents a justified region-specific limitation, which is not present here.
The file states that it generates a Chinese one-line interpretation, and multiple functions later hard-code Chinese recommendation text and report content. Because the script does not offer a language choice or opt-in, it imposes a specific language/locale on all users, which matches the natural-language policy violation criteria.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
for attempt in range(max_retries):
try:
resp = requests.post(
CONVEX_URL,
json=payload,
headers=DEFAULT_HEADERS,
No suspicious patterns detected.