Back to skill

Security audit

speech-recognition

Security checks for vulnerabilities and agentic risk

Overview

This speech-to-text skill is coherent and disclosed, but it sends audio to SiliconFlow and its example temp-file handling should be tightened before sensitive use.

Install only if you are comfortable sending audio contents to SiliconFlow for cloud transcription. Do not use it for confidential recordings without appropriate approval, and prefer an implementation that asks before upload, stores the API key securely, uses unique private temporary files, and deletes converted audio after transcription.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:81
Finding

Predictable Shared Temporary File Enables Symlink and Race Attacks

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 81–92
Vulnerability Type: Unsafe temporary-file handling
Risk Level: Medium

The documented audio-processing workflow uses the fixed, globally predictable path /tmp/audio.mp3, forcibly overwrites it, and later reads it for upload to an external transcription service.

bash
# 1. Convert the format
ffmpeg -i /path/to/audio.ogg -ar 16000 -ac 1 /tmp/audio.mp3 -y

# 2. Call the SiliconFlow API
python3 -c "
import requests
import os

api_key = os.environ.get('SILICONFLOW_API_KEY')
if not api_key:
    raise ValueError('Please set the SILICONFLOW_API_KEY environment variable')

with open('/tmp/audio.mp3', 'rb') as f:
    audio_data = f.read()

Technical Analysis

/tmp is commonly writable by all local users. Although operating systems generally apply the sticky bit to this directory, that protection does not make predictable filenames safe. An attacker who can create /tmp/audio.mp3 before the workflow runs may use a symbolic link or another filesystem object to influence the operation. The -y option instructs FFmpeg to overwrite an existing destination without confirmation.

There is also a time-of-check/time-of-use window between FFmpeg writing the output and Python reopening the same pathname. A local attacker may attempt to replace or redirect the pathname during that interval. The Python code does not verify that the opened object is a regular file, that it is owned by the expected account, or that it is the file produced by the current invocation.

Concurrent invocations also share the same path. One request may overwrite or upload another request's audio, causing cross-request data exposure and incorrect transcription. No cleanup is shown, so sensitive audio can remain in /tmp after processing.

Attack Path

  1. A local attacker predicts that the skill will use /tmp/audio.mp3.
  2. The attacker pre-creates that path as a sym ...[truncated 1652 chars]
Remediation
View remediation

Remediation Suggestions

  • Create a private temporary directory with an unpredictable name using Python's tempfile.TemporaryDirectory, or create the output with tempfile.mkstemp.
  • Restrict temporary-file permissions to the executing user, preferably mode 0600, and ensure the parent directory is mode 0700.
  • Generate a unique path for every invocation so concurrent requests cannot collide.
  • Do not use a constant pathname in a shared temporary directory.
  • Where supported, open files with protections equivalent to O_CREAT | O_EXCL | O_NOFOLLOW and verify with fstat that the object is a regular file owned by the expected user.
  • Keep the validated file descriptor open where possible instead of closing and reopening a pathname that can be replaced.
  • Pass subprocess arguments as an argument array rather than interpolating shell commands when implementing the documented workflow.
  • Delete temporary audio in a finally block or rely on automatic cleanup from TemporaryDirectory.
  • Obtain explicit user authorization before uploading audio and clearly disclose the external recipient, particularly when recordings may contain personal or confidential information.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest description forces a specific language presentation without indicating user choice or that the skill is region-specific. This can violate language or locale policy when users are not given an opt-in or alternative language.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger description '需要提取音频中的文字内容' is broad and lacks constraints or exclusion conditions, so it could match many ordinary requests involving audio processing. The file does not provide negative examples or a tighter scope to distinguish when this skill should activate versus other audio skills.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

Documenting the external API endpoint establishes that the skill depends on transmitting user audio to an outside service. In context, this is not hidden or deceptive, but it is still a true privacy and data-handling risk because sensitive content leaves the local environment.

Content

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

API 端点

text
POST https://api.siliconflow.cn/v1/audio/transcriptions

支持的模型

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

This skill explicitly uploads user audio content to an external third-party API for transcription. That is a real data exfiltration path for potentially sensitive voice content, and the risk is heightened because the skill itself notes that audio is sent to a remote server.

Content

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

md
with open("/path/to/audio.mp3", "rb") as f:
    audio_data = f.read()

response = requests.post(
    "https://api.siliconflow.cn/v1/audio/transcriptions",
    headers={"Authorization": f"Bearer {api_key}"},
    files={"file": ("audio.mp3", audio_data, "audio/mpeg")},

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This POST request includes both authentication material and audio payload transmission to a third-party endpoint. The primary danger is not the HTTPS call itself but the exposure of potentially sensitive user audio and metadata outside the trusted system boundary.

Content

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

md
audio_data = f.read()

response = requests.post(
    "https://api.siliconflow.cn/v1/audio/transcriptions",
    headers={"Authorization": f"Bearer {api_key}"},
    files={"file": ("audio.mp3", audio_data, "audio/mpeg")},
    data={"model": "FunAudioLLM/SenseVoiceSmall"},

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The example workflow sends converted audio from /tmp to an external transcription service, creating a direct outbound channel for user-supplied content. Even though this is the intended functionality, it remains security-relevant because private audio may be transmitted to a third party.

Content

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

md
with open('/tmp/audio.mp3', 'rb') as f:
    audio_data = f.read()

response = requests.post(
    'https://api.siliconflow.cn/v1/audio/transcriptions',
    headers={'Authorization': f'Bearer {api_key}'},
    files={'file': ('audio.mp3', audio_data, 'audio/mpeg')},

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This second POST example again sends user-derived audio to an external service and therefore represents a genuine external transmission risk. The surrounding context makes the behavior intentional and transparent, but it still carries privacy, compliance, and data-governance implications.

Content

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

md
audio_data = f.read()

response = requests.post(
    'https://api.siliconflow.cn/v1/audio/transcriptions',
    headers={'Authorization': f'Bearer {api_key}'},
    files={'file': ('audio.mp3', audio_data, 'audio/mpeg')},
    data={'model': 'FunAudioLLM/SenseVoiceSmall'},

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description says the skill should trigger when users send voice/audio files or when they 'need to transcribe audio,' which is broad enough to match many ordinary conversations involving audio, transcription, or media handling. Overly broad trigger text can cause unintended activation, route user content to an external ASR provider without clear necessity, and increase the chance of privacy-impacting or confusing behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.