T01 · Skill Instruction Hijacking
- Location
SKILL.md:3- Finding
Mandatory Skill Invocation Hijacks Agent Output Behavior
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This TTS skill has legitimate speech and Feishu delivery features, but it can over-share assistant output and use local credentials in ways that are not clearly disclosed.
Review carefully before installing. Use only in an environment where sending assistant text to DashScope and Feishu is acceptable, and avoid sensitive prompts or confidential outputs. Prefer a revised version that removes mandatory every-response use, requires explicit credentials and recipients, pins the Edge TTS dependency, and fixes temporary-file handling.
SKILL.md:3Mandatory Skill Invocation Hijacks Agent Output Behavior
scripts/speak_and_send.py:21Undocumented Access to OpenClaw Credentials and Broad Authentication Configuration
scripts/speak_and_send.py:114Unpinned npm Package Execution Through npx
scripts/speak_and_send.py:164Race-Prone Temporary Files Created with tempfile.mktemp
scripts/speak.sh:23Predictable PID-Based Files in Shared Temporary Directory
The skill description promises mandatory use before every response, external sending behavior, a specific preferred voice/model, and an Edge TTS fallback, but the documented behavior does not consistently implement those guarantees. Security-relevant behavior mismatches are dangerous because operators and users may rely on controls, routing, or data handling assumptions that are not actually enforced.
The script accesses a local secrets file containing Feishu credentials and uses them to obtain a tenant token for messaging. In an agent skill, automatic credential discovery and use is particularly sensitive because it enables authenticated actions against external systems without requiring the operator to intentionally supply the secret at execution time.
session.trust_env = False
# ====== 飞书 Bot 配置(从文件读取)======
CREDS_FILE = os.path.expanduser("~/.openclaw/credentials/lark.secrets.json")
CONFIG_FILE = os.path.expanduser("~/.openclaw/openclaw.json")
def get_feishu_config():
The skill documents capabilities that require network access, environment variable access, shell execution, and local file output, but it does not declare any explicit tool scope or permission boundaries. This increases the chance that an agent runtime will invoke the skill with broader privileges than users expect, reducing transparency and weakening least-privilege controls.
The skill is designed to send user-provided text to an external TTS provider and may additionally forward generated audio to Feishu, but the description lacks a prominent warning and consent boundary for that transmission. In an agent setting, this can lead to unintended disclosure of sensitive prompts, personal data, or confidential outputs to third-party services.
The instruction that this skill 'must' be used before every output forces automatic externalization of all responses into audio without user choice. That design materially increases privacy and safety risk because even low-risk text workflows become mandatory network transmissions and possible message delivery events.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
使用 curl 调用千问 TTS:
curl -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
通过文本描述创建全新音色,适合品牌定制:
curl -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
The file documents a voice cloning capability that can replicate a real person's voice but provides no safety guidance about consent, impersonation, fraud, or legal/ethical restrictions. In a TTS skill whose purpose is to convert and send audio output, this omission materially increases the risk of misuse for deception or unauthorized identity replication.
The manifest says the skill's core purpose is to convert text to speech and send it out, and even states it must be used before each output result. However, the script documentation explicitly says it only generates a local audio file and does not send to Feishu, and the implementation ends by printing the local OGG path rather than delivering the audio anywhere.
The comments state '仅生成本地音频文件,不发送飞书' and emphasize that only the TTS API key is needed, which directly conflicts with the skill description that its core purpose is to convert text to speech and send it out. This is an active contradiction between code documentation and the stated skill intent, not merely an omitted detail.
The script sets LANG to Chinese by default, which imposes a language/locale choice unless the caller explicitly overrides it. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless clearly justified as region-specific.
The script sends input text and an authorization bearer token to an external network service, which creates a real data exposure boundary. Given the skill description says this should be used before every output, the context increases risk because routine assistant responses may contain sensitive or user-specific content that is automatically transmitted off-host.
TMP_OGG="/tmp/qwen_tts_$$.ogg"
# 调用千问 API
RESPONSE=$(curl -s -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d "$(jq -n --arg text "$TEXT" --arg voice "$VOICE" --arg lang "$LANG" '{
The script transmits user-provided text to a third-party TTS service without any inline notice, consent checkpoint, or content sensitivity guard. In a skill whose core purpose is to convert potentially arbitrary assistant output into speech, this can expose confidential, personal, or sensitive data to an external provider whenever the script is invoked.
The skill reaches into unrelated local credential/config files and shell startup files to harvest Feishu and DashScope secrets, which exceeds a narrowly stated TTS function and creates unnecessary credential exposure. In this skill context, the risk is elevated because the code also sends data to external services, so local secret discovery directly enables outbound use of those credentials without explicit user mediation.
The script searches ~/.zshrc and ~/.bashrc for DASHSCOPE_API_KEY, then transmits user-provided text and derived audio to third-party services and Feishu without any user-facing disclosure or consent check. This is dangerous because it silently expands its access to sensitive local data and combines that with outbound transmission, creating privacy and credential-handling risks beyond what a minimal TTS helper should do.
The TTS request explicitly sets language_type to "Chinese", and the fallback voice is also a Chinese-specific voice, while the file does not indicate that this is a region-specific or Chinese-only skill. This forces a locale/language behavior without user opt-in, which matches the policy violation criteria.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
ogg_path = tempfile.mktemp(suffix=".ogg")
# 调用 Edge TTS,移除了 --timeout 参数避免 Node.js 内部报错
result = subprocess.run(
["npx", "node-edge-tts",
"-t", text,
"-f", mp3_path,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f"Edge TTS 警告(文件已生成): {result.stderr[:100]}")
# 转换为 OGG (opus)
conv_result = subprocess.run([
"ffmpeg", "-i", mp3_path,
"-c:a", "libopus", "-b:a", "64k", "-ar", "48000",
ogg_path, "-y"
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
ogg_path = tempfile.mktemp(suffix=".ogg")
# 生成1.5秒静音
subprocess.run([
"ffmpeg", "-f", "lavfi", "-i", "anullsrc=r=48000:cl=mono", "-t", "1.5",
silence_path, "-y"
], capture_output=True)
This ffmpeg concat invocation consumes a list file built from paths created with tempfile.mktemp and runs with '-safe 0', reducing ffmpeg's path safety checks. In combination with insecure temporary-file creation, a local attacker on the same system could race or pre-create paths/symlinks and influence what files ffmpeg reads or overwrites, making the skill more dangerous because it handles local files automatically before exfiltrating results onward.
f.write(f"file '{wav_path}'\n")
f.write(f"file '{silence_path}'\n")
subprocess.run([
"ffmpeg", "-f", "concat", "-safe", "0", "-i", concat_list,
"-c:a", "libopus", "-b:a", "64k", "-ar", "48000",
ogg_path, "-y"
The script reads DASHSCOPE_API_KEY from the environment and only reports an error if it is missing. There is no comment or user-facing warning explaining that a sensitive API credential will be used to authenticate requests to a third-party service.