T09 · Insecure Skill Coding Practices
- Location
scripts/send_group_message.sh:213- Finding
Arbitrary Shell Command Execution Through Source-Friendly Output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is transparent about its goal, but it sends Feishu group messages as the user and includes unsafe shell/script patterns that need review before installation.
Install only after reviewing and fixing the helper script. Do not source its output as shell code, restrict Feishu scopes and app credentials, require explicit confirmation before any message send or image upload, and treat all group messages and display-name prefixes as untrusted unless verified by authenticated sender IDs.
scripts/send_group_message.sh:213Arbitrary Shell Command Execution Through Source-Friendly Output
scripts/send_group_message.sh:37Arbitrary Python Execution Through Unsafe Identifier Interpolation
SKILL.md:198Spoofable Contact Attribution Through Message Prefixes
scripts/send_group_message.sh:106Direct Access to Long-Lived Feishu Application Credentials Exceeds Message-Construction Needs
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## v2.0.0 (2026-05-20)
### 破坏性变更
- **敏感信息分离**:`config.json` 不再包含 open_id / chat_id,拆分到 `secrets.json`(不纳入版本控制)
- **脚本输出格式**:从 JSON 输出改为 source-friendly 环境变量(`CHAT_ID`, `MSG_TYPE`, `MSG_CONTENT`, `HAS_IMAGE`, `IMAGE_KEY`)
- **消息格式统一**:at=true 时固定为 3 元素结构 `text(prefix) → at(对方) → text(正文)`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## v2.0.0 (2026-05-20)
### 破坏性变更
- **敏感信息分离**:`config.json` 不再包含 open_id / chat_id,拆分到 `secrets.json`(不纳入版本控制)
- **脚本输出格式**:从 JSON 输出改为 source-friendly 环境变量(`CHAT_ID`, `MSG_TYPE`, `MSG_CONTENT`, `HAS_IMAGE`, `IMAGE_KEY`)
- **消息格式统一**:at=true 时固定为 3 元素结构 `text(prefix) → at(对方) → text(正文)`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## v2.0.0 (2026-05-20)
### 破坏性变更
- **敏感信息分离**:`config.json` 不再包含 open_id / chat_id,拆分到 `secrets.json`(不纳入版本控制)
- **脚本输出格式**:从 JSON 输出改为 source-friendly 环境变量(`CHAT_ID`, `MSG_TYPE`, `MSG_CONTENT`, `HAS_IMAGE`, `IMAGE_KEY`)
- **消息格式统一**:at=true 时固定为 3 元素结构 `text(prefix) → at(对方) → text(正文)`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 权限需求
本技能核心依赖:**用户 OAuth 授权(User Access Token)**
`feishu_im_user_message` 以用户身份发消息,必须用户先完成 OAuth 授权,否则所有发送操作都会失败。
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 权限需求
本技能核心依赖:**用户 OAuth 授权(User Access Token)**
`feishu_im_user_message` 以用户身份发消息,必须用户先完成 OAuth 授权,否则所有发送操作都会失败。
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
APP_ID=$(echo "$CREDS" | python3 -c "import json,sys; print(json.load(sys.stdin)['appId'])")
APP_SECRET=$(echo "$CREDS" | python3 -c "import json,sys; print(json.load(sys.stdin)['appSecret'])")
TOKEN_RESP=$(curl -sf -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" 2>/dev/null)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
echo "错误: 获取 tenant_access_token 失败" >&2; exit 1
fi
UPLOAD_RESP=$(curl -sf -X POST 'https://open.feishu.cn/open-apis/im/v1/images' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-F "image_type=message" \
-F "image=@$IMAGE_PATH" 2>/dev/null)
The permission guide instructs agents to verify authorization by sending a real test message as the user, but it does not require prior user notice, consent for that specific action, or guidance to make the side effect explicit. That creates a silent side-effect risk: a first-use check can post unintended content into a group, which may leak context, confuse participants, or trigger workflows under the user's identity.
The skill instructs use of shell scripts (send_group_message.sh) and process substitution (source <(bash ...)) but does not declare any tool scope or allowed-tools boundary. That increases the chance an agent will invoke shell unexpectedly or without least-privilege review, which is risky because the script reads local config, may upload images, and emits variables later passed to messaging tools.
The skill explicitly describes bypassing Feishu's restriction on bot-to-bot interaction by making the bot speak through a user's identity and prepend a bot name to simulate bot messages. That is an impersonation workflow designed to evade platform controls, which can mislead recipients, defeat audit expectations, and enable unauthorized automated actions to appear user-originated.
The trigger scope is extremely broad (发消息、回复消息、发自拍、闲聊) and overlaps with ordinary conversation, making accidental invocation more likely. In this skill, mis-triggering is more dangerous than usual because the workflow can send messages under a user's identity into group chats, potentially causing unintended impersonation or spam.
The file first states as a hard rule that only feishu_im_user_message should be used for sending, and later says replies to ordinary user messages should use the message tool with Bot identity. It then further contradicts itself by banning use of message for group messages entirely. These instructions cannot all be true at once, creating intent ambiguity for agents following the skill.
The script reads local workspace identity files and automatically injects the discovered name into outgoing messages. In this skill, that behavior is used to impersonate or simulate a bot speaking through a user's identity in group chat, which increases the risk of misleading attribution and unintended disclosure of local workspace metadata beyond what is necessary to send a message.
The script silently reads Feishu application credentials from the user's local OpenClaw config and uploads a caller-supplied local file to Feishu. Because the skill is explicitly designed to act in group chats and can send images under a user's identity, this creates a meaningful risk of unauthorized external transmission of sensitive local content if invoked with an unsafe path or by a higher-level agent without clear disclosure.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
APP_ID=$(echo "$CREDS" | python3 -c "import json,sys; print(json.load(sys.stdin)['appId'])")
APP_SECRET=$(echo "$CREDS" | python3 -c "import json,sys; print(json.load(sys.stdin)['appSecret'])")
TOKEN_RESP=$(curl -sf -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" 2>/dev/null)
This markdown file contains user-facing natural language only in Chinese, with no statement that the skill is China-specific or that users can choose another language. That can conflict with a language/locale policy requiring user opt-in or documented locale justification.
The file’s natural-language instructions and warnings are entirely in Chinese, which can effectively force a specific language on users or downstream agents consuming the skill documentation. The policy allows locale constraints only when users are given a choice or when the restriction is clearly documented and justified, neither of which appears here.
Most of the document consistently describes contact/group data as stored in config.json, but the adaptive reply logic says sender matching uses secrets.json. That is an active contradiction about where identity mapping comes from, which could cause an agent to read or modify the wrong file.
The natural-language documentation strings in this manifest/config template are exclusively in Chinese. Under the policy, forcing a specific language without user opt-in can be a locale/language policy violation, and this file does not offer any alternative language or indicate that the skill is region-specific.
The script's natural-language interface elements, including description and usage comments, are entirely in Chinese and do not indicate that language selection is optional or region-specific. Under the stated policy, forcing a specific language without user opt-in is a locale-policy concern.