T09 · Insecure Skill Coding Practices
- Location
send-sms.sh:58- Finding
Arbitrary Code Execution Through Sourced .env File
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real SMS-sending skill, but it needs review because its credential handling is unsafe enough to expose or execute secrets in some setups.
Review before installing. Prefer OpenClaw-managed secrets over a .env file, do not store the SMS password in a broadly readable location, avoid setting CHANGLAN_API_URL unless you fully trust the destination, and treat this command as capable of sending paid SMS messages and transmitting recipient data to the SMS provider.
send-sms.sh:58Arbitrary Code Execution Through Sourced .env File
send-sms.sh:84Credential Exfiltration Through Unrestricted API Endpoint Override
SKILL.md:53Documentation Creates Plaintext Credential File Without Restrictive Permissions
send-sms.sh:96Unsafe JSON Construction Allows Request-Body Injection and Malformation
The documentation instructs users to place API credentials in environment variables and nearby .env-based configuration, which can be risky if developers copy these patterns into insecure contexts such as shared shells, logs, or improperly permissioned files. In a messaging skill, these secrets enable direct access to SMS-sending capabilities and could be abused for fraud, spam, or account misuse if exposed.
export CHANGLAN_PASSWORD=你的API密码
#### 方式三:.env 文件
```bash
cd ~/.claude/skills/sms-chuanglan
The skill explicitly instructs users to write API credentials into a .env file under the skill directory. Storing credentials in plaintext on disk is dangerous because local compromise, accidental backup/sync, misconfigured permissions, or accidental commits can expose the SMS provider account and allow unauthorized message sending.
cd ~/.claude/skills/sms-chuanglan
echo "CHANGLAN_ACCOUNT=你的API账号" > .env
echo "CHANGLAN_PASSWORD=你的API密码" >> .env
This line appends the API password directly into a plaintext .env file, making the most sensitive credential persist on disk in a predictable location. Because this skill's purpose is sending SMS through a third-party provider, leaked credentials could be used to send unauthorized messages, incur charges, or abuse trusted communication channels.
cd ~/.claude/skills/sms-chuanglan
echo "CHANGLAN_ACCOUNT=你的API账号" > .env
echo "CHANGLAN_PASSWORD=你的API密码" >> .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="${SCRIPT_DIR}/.env"
usage() {
echo "用法: send-sms.sh --phone <手机号> --template <模板ID> [--vars <变量JSON>]"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
usage
fi
# 读取配置(优先环境变量,其次 .env 文件)
load_config() {
# 优先使用环境变量
if [[ -z "$CHANGLAN_ACCOUNT" ]] || [[ -z "$CHANGLAN_PASSWORD" ]]; then
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
usage
fi
# 读取配置(优先环境变量,其次 .env 文件)
load_config() {
# 优先使用环境变量
if [[ -z "$CHANGLAN_ACCOUNT" ]] || [[ -z "$CHANGLAN_PASSWORD" ]]; then
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
usage
fi
# 读取配置(优先环境变量,其次 .env 文件)
load_config() {
# 优先使用环境变量
if [[ -z "$CHANGLAN_ACCOUNT" ]] || [[ -z "$CHANGLAN_PASSWORD" ]]; then
Using source "$ENV_FILE" executes the contents of .env as shell code, not merely as data. If an attacker can modify that file, they can achieve arbitrary command execution in the context of the script, making this substantially more dangerous than ordinary credential loading in an agent skill that may run unattended.
load_config() {
# 优先使用环境变量
if [[ -z "$CHANGLAN_ACCOUNT" ]] || [[ -z "$CHANGLAN_PASSWORD" ]]; then
# 尝试读取 .env 文件
if [[ -f "$ENV_FILE" ]]; then
source "$ENV_FILE"
fi
The skill declares shell-related runtime requirements and demonstrates command execution patterns, but it does not define any explicit tool scope such as permissions or allowed-tools. That creates an overbroad execution surface where an agent may invoke shell capabilities without a clearly constrained policy, increasing the chance of unintended command execution or misuse in a credential-handling skill.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
fi
# 调用 API
local response=$(curl -s -m 30 -X POST "${CHANGLAN_API_URL}" \
-H "Content-Type: application/json" \
-d "${request_body}")
The script performs an HTTP POST that includes the account, password, phone number, template ID, and optional template variables, but there is no confirmation prompt or explicit user-facing disclosure immediately before transmission. Because this is a code file and the operation sends sensitive credential and recipient data to an external API, it should provide a clear warning or notice.
The manifest exposes a command that sends phone numbers and template variables to a third-party SMS provider, but it does not warn users that personal data will leave the local system and be transmitted externally. This creates a privacy and consent risk, especially because phone numbers and message content may contain sensitive personal or business information.
The usage/help text is entirely in Chinese, and the same language choice continues throughout the script's user-facing messages. Under the policy, forcing a specific language without user opt-in or a documented locale-specific justification is a natural-language policy issue.
The natural-language descriptions for the skill and its arguments are exclusively in Chinese, which may impose a language requirement without user opt-in. There is no accompanying note that the skill is intended only for a Chinese-speaking or region-specific context.