Back to skill

Security audit

Fun ASR Nano Transcribe

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a genuine Chinese speech-to-text skill, but it needs user review because it can start a persistent local API service, manage processes, and transcribe arbitrary local file paths with weak safeguards.

Install only if you are comfortable running a local transcription service. Prefer the one-shot CLI mode for occasional files, avoid exposing port 11890, remove or restrict /transcribe/path before use, and review the startup scripts and dependency/model pinning before enabling persistent API mode.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/api_client.py:57
Finding

Shell Command Injection Through an Unquoted Skill Directory

Content
View full analysis
{log_file} 2>&1 & echo $! > {pid_file} """ subprocess.Popen(cmd, shell=True, executable='/bin/bash') ``` ### Technical Analysis The `skill_dir` value is inserted directly into a multiline Bash command without shell quoting. The resulting string is then passed to `subprocess.Popen()` with `shell=True`. Although `skill_dir` is normally derived from the location of `api_client.py`, filesystem paths can contain spaces, command separators, command substitutions, newlines, and other shell metacharacters. If the project is installed or copied under an attacker-controlled path, Bash interprets those characters as syntax rather than as part of a directory name. For example, a directory component containing a command substitution such as `$(malicious-command)` would be evaluated when the generated `cd` line is parsed. The use of an argument list elsewhere in the application does not mitigate this call because the entire command is explicitly delegated to Bash. Automatic server startup is useful for the declared transcription functionality, but execution through an interpolated shell exceeds the minimum mechanism required. Python can start the server directly with a controlled working directory and environment. ### Attack Path 1. An attacker distributes, extracts, relocates, or causes the Skill to be installed under a directory whose name contains shell metacharacters. 2. A user runs: ```bash python scripts/api_c ...[truncated 911 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/api_server.py:169
Finding

Unauthenticated API Endpoint Can Transcribe Arbitrary Local Files

Content
View full analysis
Remediation
View remediation
Path: requested = Path(file_path).resolve(strict=True) if ALLOWED_AUDIO_ROOT not in requested.parents: raise HTTPException(status_code=403, detail="Path is outside the allowed directory") if not requested.is_file() or requested.is_symlink(): raise HTTPException(status_code=400, detail="A regular audio file is required") if requested.suffix.lower() not in ALLOWED_EXTENSIONS: raise HTTPException(status_code=400, detail="Unsupported audio format") if requested.stat().st_size > 100 * 1024 * 1024: raise HTTPException(status_code=413, detail="Audio file is too large") return requested ``` ]]>

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned Dependencies and Mutable Model Downloads Weaken Supply-Chain Integrity

Content
View full analysis
=1.0.0 modelscope>=1.10.0 torch>=2.0.0 torchaudio>=2.0.0 # 音频处理 numpy>=1.24.0 # 日志 loguru>=0.7.0 # 模型加载 transformers>=4.30.0 # API 服务(可选) fastapi>=0.100.0 uvicorn>=0.23.0 python-multipart>=0.0.6 # 客户端(可选) requests>=2.28.0 ``` `scripts/setup_venv.sh`: ```bash # 升级 pip echo "" echo "⬆️ 升级 pip..." pip install --upgrade pip # 安装 PyTorch (CPU 版本,如需 GPU 请手动修改) echo "" echo "🔥 安装 PyTorch..." pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu # 安装 FunASR 和 ModelScope echo "" echo "🎤 安装 FunASR 和 ModelScope..." pip install funasr modelscope # 安装其他依赖 echo "" echo "📚 安装其他依赖..." pip install numpy loguru ``` `scripts/download_model.py`: ```python def download_from_modelscope(model_id: str, output_dir: str, cache_dir: str = None): """从 ModelScope 下载模型""" try: from modelscope import snapshot_download except ImportError: logger.error("❌ 请先安装 modelscope: pip install modelscope") sys.exit(1) if cache_dir is None: cache_dir = Path.home() / ".cache" / "modelscope" # 自动创建 Fun-ASR-Nano-2512 子目录 output_path = Path(output_dir) / "Fun-ASR-Nano-2512" output_path.mkdir(parents=True, exist_ok=True) logger.info(f"🚀 从 ModelScope 下载: {model_id}") logger.info(f"📁 输出目录: {output_path}") try: local_dir = snapshot_download( model_id, cache_dir=str(cache_dir), local_dir=str(output_path) ) logger.info(f"✅ 下载完成: {local_dir}") return local_dir ``` ### Technical Analysis The dependency declarations use lower-bound constraints such as `>=` rather than exact versions. The ...[truncated 2334 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (58)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill includes undocumentedly sensitive operational behavior relative to its headline purpose: starting/stopping local services, handling PID files, and killing processes by port. Process management is privileged compared with plain transcription and can disrupt unrelated local services if implemented unsafely or misunderstood by the agent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The skill includes undocumentedly sensitive operational behavior relative to its headline purpose: starting/stopping local services, handling PID files, and killing processes by port. Process management is privileged compared with plain transcription and can disrupt unrelated local services if implemented unsafely or misunderstood by the agent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill includes undocumentedly sensitive operational behavior relative to its headline purpose: starting/stopping local services, handling PID files, and killing processes by port. Process management is privileged compared with plain transcription and can disrupt unrelated local services if implemented unsafely or misunderstood by the agent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill includes undocumentedly sensitive operational behavior relative to its headline purpose: starting/stopping local services, handling PID files, and killing processes by port. Process management is privileged compared with plain transcription and can disrupt unrelated local services if implemented unsafely or misunderstood by the agent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill includes undocumentedly sensitive operational behavior relative to its headline purpose: starting/stopping local services, handling PID files, and killing processes by port. Process management is privileged compared with plain transcription and can disrupt unrelated local services if implemented unsafely or misunderstood by the agent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guidance instructs the agent to automatically transcribe incoming voice and respond as if it had directly received text, without disclosing that speech recognition occurred. This undermines user awareness and consent, especially because voice content may contain sensitive information and the skill may auto-start a persistent service to process it.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The auto-activation rules are broad enough that ordinary voice messages can trigger transcription and downstream actions without a clear explicit request. In an agent environment, that can cause unintended collection and processing of user audio, surprise resource consumption, and execution of setup/server actions beyond the user's immediate intent.

Content

No source excerpt is available for this finding.

Possible Typosquatting: 'uvicorn' resembles popular package 'gunicorn'

High
Category
Supply Chain
Confidence
70% confidence
Finding

Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

This is the same unsafe shell-based process launch pattern: a dynamically formatted shell script is passed to Popen with shell=True. In an agent skill, this is more dangerous because filesystem paths or packaging context may be externally influenced, turning a convenience startup path into arbitrary command execution.

Content

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

python
nohup python scripts/api_server.py > {log_file} 2>&1 &
echo $! > {pid_file}
"""
    subprocess.Popen(cmd, shell=True, executable='/bin/bash')
    
    print("⏳ 等待服务启动(约 30 秒)...")
    time.sleep(30)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

This is the same unsafe shell-based process launch pattern: a dynamically formatted shell script is passed to Popen with shell=True. In an agent skill, this is more dangerous because filesystem paths or packaging context may be externally influenced, turning a convenience startup path into arbitrary command execution.

Content

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

python
nohup python scripts/api_server.py > {log_file} 2>&1 &
echo $! > {pid_file}
"""
    subprocess.Popen(cmd, shell=True, executable='/bin/bash')
    
    print("⏳ 等待服务启动(约 30 秒)...")
    time.sleep(30)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Accepting arbitrary filesystem paths from API input is a genuine security issue because it exposes host file access unrelated to the stated purpose of transcribing user-provided audio files. An attacker with access to the service can probe for file existence and potentially cause processing of sensitive local audio files, network-mounted paths, or special files, depending on the runtime environment and transcriber behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documents capabilities to execute shell commands, install packages, download models, start/stop services, and interact with local files and network resources, but it does not declare any explicit tool scope or permissions. In an agent setting, this creates hidden authority and weakens policy enforcement because the runtime may permit broader actions than the user expects from a transcription skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest description states the skill provides Chinese speech recognition and emphasizes Chinese-only transcription. Under the policy criteria, language/locale constraints should either offer user opt-in or be clearly documented as a justified region- or compliance-specific limitation, which is not present here.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Using prior conversation history alone as a trigger to auto-start a service is ambiguous and can persist behavior longer than the user expects. This increases the risk of silent background resource use and unintended processing of later audio inputs.

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 299)May include surrounding context.

md
# 上传音频
with open('audio.wav', 'rb') as f:
    files = {'audio': f}
    response = requests.post('http://localhost:11890/transcribe', files=files)

result = response.json()
if result['success']:

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

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

md
# 上传音频
with open('audio.wav', 'rb') as f:
    files = {'audio': f}
    response = requests.post('http://localhost:11890/transcribe', files=files)

result = response.json()
if result['success']:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation expands a local transcription skill into a Flask service that listens on a network interface, materially increasing attack surface beyond the stated skill scope. Even as an example, binding a transcription endpoint to a server can enable unauthorized use, abuse of compute resources, and exposure of uploaded audio or transcribed content if deployed without authentication, transport security, or rate limiting.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The example unjustifiably exposes transcription over a public interface via Flask, which is not necessary for the advertised local ASR functionality. This can lead users to deploy an unauthenticated service on 0.0.0.0, allowing remote parties to submit arbitrary audio, consume resources, and potentially obtain sensitive transcript data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest describes a lightweight Chinese ASR skill that converts audio to text, but this file defines a composite model that combines an audio encoder, adaptor, and a causal language model, with chat-style prompt templating and generic text generation via self.llm.generate. The code supports assistant/user/system roles, labels, loss computation, and arbitrary language-generation behavior beyond straightforward transcription, which is broader than the manifest's stated scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill constructs its transcription instruction entirely in Chinese strings such as "请结合上下文信息" and "语音转写", which imposes a specific language/locale in the skill's natural-language behavior. There is no accompanying opt-in, user choice, or documentation justifying that the skill is intended only for a Chinese-language context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code presents docstrings, error messages, and status text exclusively in Chinese, which can impose a specific language on users or operators. Under the policy, forcing a language without opt-in or documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This client can silently transition from a simple API caller into a process launcher that starts a background server. That expands the tool's authority beyond transcription and creates security and operational risk because running local code and services may be unexpected in the client context, especially when triggered by an option that users may not fully understand.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code offers automatic background server startup but provides only minimal notice before creating a detached process and writing PID/log files in /tmp. While not an exploit by itself, the lack of explicit warning and consent increases the chance of unsafe or unexpected execution in interactive or agent-driven environments.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
82% confidence
Finding

The use of nohup indicates intent to leave the server running after the client exits, creating a persistent local service. In a skill context, this is riskier than a one-shot transcription action because it leaves a long-lived process and related artifacts behind, potentially widening exposure if the server is insecure or not expected to remain active.

Content

Scanner excerpt · scripts/api_client.py (reported line 64)May include surrounding context.

python
print("🚀 服务未运行,正在自动启动...")
    
    # 使用 nohup 启动服务
    log_file = "/tmp/funasr_api.log"
    pid_file = "/tmp/funasr_api.pid"

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

This command launches the API server with nohup in the background and records its PID, establishing persistence beyond the current session. A persistent local service can increase attack surface and surprise users or orchestrators that expected only transient client behavior.

Content

Scanner excerpt · scripts/api_client.py (reported line 72)May include surrounding context.

python
cmd = f"""
cd {skill_dir}
source .venv/bin/activate
nohup python scripts/api_server.py > {log_file} 2>&1 &
echo $! > {pid_file}
"""
    subprocess.Popen(cmd, shell=True, executable='/bin/bash')

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/FunASRNano.py:66