T09 · Insecure Skill Coding Practices
- Location
src/feishu_voice.py:187- Finding
Unnecessary Disclosure of the Complete User Prompt to the TTS Provider
- Content
View full analysis
Vulnerability Details
File Location:
src/feishu_voice.py:187-190andsrc/feishu_voice.py:372
Vulnerability Type: Excessive transmission of potentially sensitive user data
Risk Level: MediumVulnerable Code
python # Add context_texts when context is provided if context: payload["req_params"]["additions"] = json.dumps({ "context_texts": [context] })python # Generate voice opus_path = generate_voice(text, emotion, user_input)Technical Analysis
send_voice_message()passes the completeuser_inputvalue togenerate_voice()as itscontextargument. The function then adds that value to the TTS request ascontext_texts, causing it to be transmitted tohttps://openspeech.bytedance.com.This exceeds the minimum data required to synthesize the requested voice message. The code already calls
detect_emotion()locally and derives an emotion label, but theemotionargument accepted bygenerate_voice()is not used in the outgoing request. Instead, the full original prompt is transmitted.Although the transmission uses HTTPS and targets the documented TTS provider,
user_inputmay contain secrets, personal information, identifiers, unrelated conversation details, or instructions that are not part of the text the user requested to synthesize. The documentation describes the context as being used for emotion awareness, but it does not adequately communicate that the complete original request is shared with the external provider.Attack Path
- A caller invokes
send_voice_message()with legitimate synthesis text. - The caller or surrounding Agent places sensitive or unrelated information in
user_input. send_voice_message()passes the complete value togenerate_voice().generate_voice()serializes it intoreq_params.additions.context_texts.- The complete prompt is transmitted to the external ByteDance TTS endpoint.
- The ...[truncated 635 chars]
- A caller invokes
- Remediation
View remediation
Remediation Suggestions
- Do not send the raw
user_inputvalue to the TTS service by default. - Use only the locally derived emotion classification, such as
happy,sad, orneutral, if the provider supports an equivalent constrained parameter. - If contextual text is indispensable, require explicit user consent before sharing it with the external service.
- Restrict context to a short, purpose-specific value and apply sensitive-data filtering.
- Document precisely which fields are transmitted, to which provider, and for what purpose.
- Remove the unused
emotionargument or implement it through a constrained provider-supported option rather than forwarding the complete prompt.
- Do not send the raw
