T09 · Insecure Skill Coding Practices
- Location
scripts/voice_speak.py:24- Finding
Hard-Coded Doubao TTS Access Token
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This voice-output skill is mostly coherent for cloud text-to-speech, but it ships a plaintext service token and uses under-scoped invocation instructions that warrant review before installation.
Before installing, require the publisher to remove and rotate the embedded Doubao token, document that response text is sent to a third-party TTS service and played aloud, narrow the trigger phrases, and update invocation guidance so speech text is passed as a literal argument or stdin rather than interpolated into a shell command. Avoid using it for secrets or private content until those issues are fixed.
scripts/voice_speak.py:24Hard-Coded Doubao TTS Access Token
scripts/voice_speak.py:38Symlink-Unsafe and Non-Atomic Lock File in Shared Temporary Directory
SKILL.md:20Unsafe Shell Command Template for Agent-Generated Speech Text
The skill description omits materially important behaviors: outbound transmission of response text to an external TTS provider, local audio file creation, and reliance on local playback rather than a guaranteed specific device. This mismatch can cause sensitive content to be exfiltrated or played aloud unexpectedly because reviewers and users are not given an accurate picture of what the skill actually does.
The skill also fails to warn that generated audio will be played aloud on a connected speaker, which can expose confidential content to bystanders. In the context of an assistant skill, this increases the risk of inadvertent disclosure in shared homes, offices, or public spaces.
The script embeds a live APPID and access token directly in source code, which exposes secrets to anyone who can read the repository, logs, backups, or deployed files. An attacker could reuse these credentials to access the TTS service, incur charges, abuse the account, or pivot into related cloud resources depending on provider permissions.
The skill declares shell, network, and file-writing capabilities implicitly through its documented invocation, but it does not declare any tool scope or permissions. This weakens reviewability and enforcement, making it easier for an agent to use sensitive capabilities without explicit authorization boundaries.
The skill also fails to warn that generated audio will be played aloud on a connected speaker, which can expose confidential content to bystanders. In the context of an assistant skill, this increases the risk of inadvertent disclosure in shared homes, offices, or public spaces.
The single-word trigger '语音' is too broad and likely to occur in ordinary dialogue, increasing the chance of accidental invocation. Because this skill externalizes and vocalizes content, false triggers can create privacy leaks and confusing or disruptive behavior.
The catch-all trigger phrase 'Or any similar request' is overly vague and can cause accidental activation from normal conversation. In this skill, unintended activation is risky because it may send arbitrary response text to an external TTS service and play it aloud to nearby listeners.
The function sends arbitrary spoken content to an external TTS provider, which can disclose sensitive user data, internal prompts, credentials, or personal information if passed into the script. In a voice-output skill, this is contextually more dangerous because users may assume speech is generated locally and may not realize their text is being transmitted to a third party.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
f.write(audio_data)
# 阻塞等待播放完成,带超时保护
result = subprocess.run(
["afplay", "-q", "1", tmp_file], # -q 1 = 高质量,阻塞
capture_output=True,
timeout=AFPLAY_TIMEOUT,
SQP-3 applies to all file types and includes language or locale policy violations. This markdown reference forces a single language presentation without any opt-in, alternative language guidance, or justification that the skill is region-specific.
The natural-language interface, examples, and defaults are entirely presented in Chinese, and the script's usage suggests operation around Chinese text and a Chinese voice model. There is no indication that users may choose another language or locale, which can violate a language-choice policy when not explicitly justified.