Back to skill

Security audit

Qwen Tts

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed cloud TTS skill with an optional Feishu sender; it has privacy and temp-file hardening risks but no artifact-backed hidden persistence, prompt hijacking, or deceptive exfiltration.

Install only if you are comfortable sending TTS text to Alibaba DashScope. Use the local speak.sh path for ordinary generation, and configure FEISHU_* only if you intentionally want generated audio uploaded and sent through Feishu. Avoid sensitive text unless your provider agreements allow it, restrict Feishu app permissions, and prefer a version that fixes temporary-file races and adds clearer consent warnings for voice cloning and message sending.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/speak.sh:23
Finding

Predictable Temporary Files Permit Symlink-Based File Overwrite

Content
View full analysis
/dev/null ``` ### Technical Analysis The script constructs temporary filenames directly under `/tmp` using only the current process ID. Process IDs are observable and sufficiently predictable on multi-user systems. The script does not atomically reserve these files before `curl` and `ffmpeg` write to them. An attacker with local access can pre-create a matching path as a symbolic link or race the script between path selection and file creation. Depending on ownership and operating-system protections, the write operation may follow the link and overwrite another file writable by the Skill's invoking account. At minimum, pre-created paths can interfere with processing and cause denial of service. Shell quoting prevents command injection through these variables, but it does not protect against filesystem race conditions or symbolic links. ### Attack Path 1. A local attacker monitors process creation or predicts the process ID that will execute `speak.sh`. 2. The attacker creates `/tmp/qwen_tts_.wav` or `/tmp/qwen_tts_.ogg` before the script writes to it. 3. The path is made a symbolic link to a target file, or an incompatible file is placed there to disrupt execution. 4. `curl` or `ffmpeg` accesses the attacker-controlled path. 5. If the target is writable by the invoking user and platform protections permit following the link, its contents may be overwritten. Otherwise, the operation fails, resulting in denial of service. ### Impact Assessment Successful exploitation can overwrite files accessible t ...[truncated 318 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/speak_and_send.py:72
Finding

Deprecated tempfile.mktemp Usage Creates Temporary-File Race Conditions

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (29)

Tainted flow: 'FEISHU_APP_ID' from os.environ.get (line 16, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 25)May include surrounding context.

python
def get_feishu_token():
    resp = requests.post(
        'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal',
        json={'app_id': FEISHU_APP_ID, 'app_secret': FEISHU_APP_SECRET}
    )

Tainted flow: 'api_key' from os.environ.get (line 33, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 37)May include surrounding context.

python
if not api_key:
        raise ValueError("DASHSCOPE_API_KEY not set")

    resp = requests.post(
        'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation',
        headers={
            'Authorization': f'Bearer {api_key}',

Tainted flow: 'ogg_path' from requests.post (line 140, network input) → subprocess.run (code execution)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

External input (network, user) flows to a code execution sink. This enables remote code execution or command injection.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 87)May include surrounding context.

python
f.write(f"file '{silence_path}'\n")

    ogg_path = tempfile.mktemp(suffix='.ogg')
    subprocess.run([
        'ffmpeg', '-f', 'concat', '-safe', '0', '-i', concat_list,
        '-c:a', 'libopus', '-b:a', '64k', '-ar', '48000',
        ogg_path, '-y'

Tainted flow: 'FEISHU_USER_ID' from os.environ.get (line 18, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 118)May include surrounding context.

python
file_key = upload_data['data']['file_key']

    send_resp = requests.post(
        'https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id',
        headers={'Authorization': f'Bearer {token}'},
        json={

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The documented behavior extends beyond simple text-to-speech by optionally sending generated audio to a Feishu user using additional credentials and external messaging APIs. This is materially different from a plain TTS skill and can result in user content being transmitted to third-party messaging destinations without that risk being prominent in the core description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented behavior extends beyond simple text-to-speech by optionally sending generated audio to a Feishu user using additional credentials and external messaging APIs. This is materially different from a plain TTS skill and can result in user content being transmitted to third-party messaging destinations without that risk being prominent in the core description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script accesses Feishu credentials and messaging APIs even though the declared skill purpose is TTS. This hidden extra capability increases blast radius because the skill can authenticate to an external messaging platform and transmit artifacts outside the expected execution boundary.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill manifest describes TTS generation, but the code also uploads the synthesized audio to Feishu and sends it to a user account. This exceeds the declared purpose and creates an unexpected exfiltration channel for user content, especially dangerous when users think the skill only performs local or direct TTS generation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documentation describes capabilities that use environment variables, shell commands, network access, and local file output, but it does not declare any explicit tool scope or permission boundaries. This increases the risk of over-broad execution in an agent runtime, because a caller may invoke networked and file-writing behavior without a clear, least-privilege contract.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 43)May include surrounding context.

基本语音合成(同步接口)

使用 curl 调用千问 TTS:

bash
curl -X POST 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 105)May include surrounding context.

请求示例

bash
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 '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/api.md (reported line 20)May include surrounding context.

请求示例

bash
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 '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/voices.md (reported line 58)May include surrounding context.

通过文本描述创建全新音色,适合品牌定制:

bash
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 '{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The voice cloning section provides a direct example for recreating a real person's voice but omits any warning about consent, identity misuse, impersonation, or handling of biometric voice data. In a TTS skill, this lowers friction for misuse such as unauthorized cloning, social engineering, and privacy violations, making the omission a real safety and security weakness even though the file is documentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script transmits user-supplied text to a third-party cloud TTS service, which creates a real data exposure risk if users provide sensitive or regulated content. In this skill context, external transmission is core functionality, but the lack of an explicit execution-time warning or consent mechanism means users may unknowingly send private text off-device.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

This code sends text and an API bearer token to an external service over the network, which is a genuine external data transmission event. In a TTS skill this behavior is expected, but it remains security-relevant because sensitive user content may leave the local environment and the returned audio URL is then fetched without additional validation.

Content

Scanner excerpt · scripts/speak.sh (reported line 26)May include surrounding context.

sh
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" '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 25)May include surrounding context.

python
def get_feishu_token():
    resp = requests.post(
        'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal',
        json={'app_id': FEISHU_APP_ID, 'app_secret': FEISHU_APP_SECRET}
    )

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 25)May include surrounding context.

python
def get_feishu_token():
    resp = requests.post(
        'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal',
        json={'app_id': FEISHU_APP_ID, 'app_secret': FEISHU_APP_SECRET}
    )

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

Duplicate of the DashScope external-transmission finding: user content is sent to a third-party provider without explicit disclosure. The danger is privacy exposure, not the existence of network traffic itself.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 37)May include surrounding context.

python
if not api_key:
        raise ValueError("DASHSCOPE_API_KEY not set")

    resp = requests.post(
        'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation',
        headers={
            'Authorization': f'Bearer {api_key}',

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

Duplicate of the DashScope external-transmission finding: user content is sent to a third-party provider without explicit disclosure. The danger is privacy exposure, not the existence of network traffic itself.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 37)May include surrounding context.

python
if not api_key:
        raise ValueError("DASHSCOPE_API_KEY not set")

    resp = requests.post(
        'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation',
        headers={
            'Authorization': f'Bearer {api_key}',

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-supplied text is sent to an external TTS provider without any explicit warning or consent flow. If users provide sensitive content, the skill silently transfers that content to a third party, creating privacy and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The request payload forces language_type to Chinese, which constitutes a locale/language constraint in natural-language behavior. The file does not present this as an opt-in choice or explain a region-specific justification, so it conflicts with the policy against forcing a specific language without user opt-in.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 75)May include surrounding context.

python
"""给音频末尾加1秒空白,转换为ogg"""
    silence_path = tempfile.mktemp(suffix='.wav')
    # 生成1秒静音
    subprocess.run([
        'ffmpeg', '-f', 'lavfi', '-i', 'anullsrc=r=48000:cl=mono', '-t', '1.5',
        silence_path, '-y'
    ], capture_output=True)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
90% confidence
Finding

This ffmpeg call processes a concat list built from temporary file paths while explicitly setting '-safe 0', which disables ffmpeg path-safety checks. Combined with insecure tempfile.mktemp usage, a local attacker could race or replace temporary paths or concat-list contents and cause ffmpeg to read unintended files or attacker-controlled inputs.

Content

Scanner excerpt · scripts/speak_and_send.py (reported line 87)May include surrounding context.

python
f.write(f"file '{silence_path}'\n")

    ogg_path = tempfile.mktemp(suffix='.ogg')
    subprocess.run([
        'ffmpeg', '-f', 'concat', '-safe', '0', '-i', concat_list,
        '-c:a', 'libopus', '-b:a', '64k', '-ar', '48000',
        ogg_path, '-y'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The generated audio is uploaded and sent to Feishu without explicit notice that user-derived content will be transmitted to an external messaging platform. This is more dangerous than ordinary TTS because it forwards content to an additional service and recipient context the user may not expect.

Content

No source excerpt is available for this finding.