Back to skill

Security audit

Local Audio2SRT

Security checks for vulnerabilities and agentic risk

Overview

The skill builds the stated local transcription app, but the generated backend exposes unauthenticated network APIs that can process local files and consume host resources.

Review this carefully before installing. Run it only in an isolated local environment, bind the backend to 127.0.0.1, restrict CORS, add an auth token, avoid arbitrary file_path transcription, and pin dependencies/model revisions before using sensitive audio.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (6)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/transcribe_server.py:390
Finding

Unauthenticated Cross-Origin Access to Local-File Transcription

Content
View full analysis
web.Response: """启动转录任务""" body = await request.json() file_path = body.get("file_path") if not file_path or not os.path.isfile(file_path): return web.json_response({"error": "file_path 不存在"}, status=400) model = body.get("model") or DEFAULT_WHISPER_MODEL language = body.get("language", "auto") chunk_sec = int(body.get("chunk_sec", 150)) overlap_sec = int(body.get("overlap_sec", 20)) tasks_store[task_id] = { "id": task_id, "file_path": file_path, "file_name": os.path.basename(file_path), "model": model, ``` ```python async def task_status_handler(request: web.Request) -> web.Response: task_id = request.match_info["task_id"] task = tasks_store.get(task_id) if not task: return web.json_response({"error": "Task not found"}, status=404) response = { "id": task["id"], "file_name": task["file_name"], "model": task["model"], "language": task["language"], "chunk_sec": task["chunk_sec"], "overlap_sec": task["overlap_sec"], "status": task["status"], "progress": task["progress"], "current_chunk": task["current_chunk"], "total_chunks": task["total_chunks"], "skipped_chunks": task["skipped_chunks"], "skipped_chunk_indexes": task["skipped_chunk_indexes"], "segments": task["segments"], "duration": task["duration"], "error": task["error"], "completed_at": task["completed_at"], } return web.json_response(response) ``` ```python @web.middleware async def cors_middleware(request: web.Request, ...[truncated 2307 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/transcribe_server.py:367
Finding

Unbounded Uploads, Task Creation, and Temporary-File Retention

Content
View full analysis
web.Response: reader = await request.multipart() field = await reader.next() if not field or not field.filename: return web.json_response({"error": "No file uploaded"}, status=400) suffix = Path(field.filename).suffix or ".wav" temp_path = os.path.join(UPLOAD_DIR, f"{uuid.uuid4().hex}{suffix}") with open(temp_path, "wb") as f: while True: chunk = await field.read_chunk(8192) if not chunk: break f.write(chunk) ``` ```python # 在后台线程中运行转录 loop = asyncio.get_event_loop() thread = threading.Thread(target=run_transcription, args=(task_id,), daemon=True) thread.start() ``` ```python async def translate_handler(request: web.Request) -> web.Response: body = await request.json() segments = body.get("segments", []) if not segments: return web.json_response({"error": "No segments provided"}, status=400) source_language = body.get("source_language", "ja") target_language = body.get("target_language", "zh") model_id = body.get("model") or DEFAULT_TRANSLATE_MODEL try: loop = asyncio.get_event_loop() translated = await loop.run_in_executor( None, do_translate, segments, source_language, target_language, model_id ) ``` ### Technical Analysis The application does not define an upload-size quota, request rate limit, task-count limit, translation text limit, or bounded transcription worker queue. Every transcription request starts a separate thread. Uploaded files ...[truncated 1313 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/transcribe_server.py:274
Finding

Caller-Controlled Model Paths and Repository Identifiers

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/requirements.txt:1
Finding

Mutable and Unpinned Dependency Installation

Content
View full analysis
=3.9.0 mlx-whisper>=0.4.3 mlx-lm>=0.31.0 soundfile>=0.12.0 numpy>=1.24.0 ``` `references/package.json`: ```json "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", "@mui/icons-material": "^5.15.20", "@mui/material": "^5.15.20", "react": "^18.3.1", "react-dom": "^18.3.1", "react-dropzone": "^14.2.3", "zustand": "^4.5.2" }, "devDependencies": { "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.0", "autoprefixer": "^10.4.19", "postcss": "^8.4.38", "tailwindcss": "^3.4.4", "typescript": "^5.4.5", "vite": "^5.3.1" } ``` `references/start.sh`: ```bash ensure_modelscope() { if python3 -c "import modelscope" 2>/dev/null; then echo " ✓ modelscope 已安装" return 0 fi echo " [安装] modelscope(模型下载工具)..." pip3 install modelscope -q 2>&1 | tail -3 ``` ### Technical Analysis Python packages use only lower-bound constraints, npm packages use mutable compatible-version ranges, and `modelscope` is installed without any version restriction. No npm lockfile, Python hash manifest, or model revision manifest is included. Consequently, installations performed at different times can retrieve materially different code from package registries. The setup instructions also install Python packages into the active environment unless the user independently chooses the optional virtual-environment approach. This finding does not demonstrate that a currently named package is malicious. The risk is that the reviewed Skill does not reproducibly constrain the code that package managers will later install and execute. ### Attack Path 1. A use ...[truncated 731 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
references/transcribe_server.py:33
Finding

Race Condition in Temporary WAV File Creation

Content
View full analysis
str: """如果音频格式不被 soundfile 支持(如 m4a/mp3),用 afconvert 转为 WAV。 返回临时 WAV 路径或原始路径(如果格式已支持)。""" ext = Path(audio_path).suffix.lower() if ext in SF_SUPPORTED: return audio_path # 用 macOS 内置 afconvert 转换 tmp_wav = tempfile.mktemp(suffix=".wav") try: subprocess.run( ["afconvert", "-f", "WAVE", "-d", "LEI16", audio_path, tmp_wav], check=True, capture_output=True, text=True, ) return tmp_wav except subprocess.CalledProcessError as e: raise RuntimeError(f"音频格式转换失败 ({ext}):{e.stderr.strip() if e.stderr else e}") ``` ### Technical Analysis `tempfile.mktemp()` generates a pathname but does not atomically create and reserve the file. A window exists between pathname generation and `afconvert` opening the destination. Another local process operating as the same user, or otherwise able to manipulate the temporary directory entry, may create a file or symbolic link at that pathname before the conversion process uses it. The subprocess invocation uses an argument array and is not vulnerable to shell command injection; the issue is specifically the non-atomic temporary-file lifecycle. ### Attack Path 1. The application generates a temporary WAV pathname with `mktemp()`. 2. Before `afconvert` opens the destination, a local attacker creates an entry at that path. 3. The entry points to or replaces another location writable by the victim. 4. `afconvert` writes to the attacker-influenced destination. 5. The intended converted audio may also be substituted or corrupted. ### Impact Assessment A successful local race may overwrite a file writable by the application user or alter the audio supplied to transcription. Exploitation requires local access and ...[truncated 69 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:165
Finding

Troubleshooting Instructions Force-Kill Unrelated Processes

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (62)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A skill that advertises local/offline deployment but actually performs different runtime behavior creates a trust and transparency problem. In a security context, undeclared behavior such as downloading extra models or launching services can expose a host to unexpected code paths, data flow, or resource consumption.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A skill that advertises local/offline deployment but actually performs different runtime behavior creates a trust and transparency problem. In a security context, undeclared behavior such as downloading extra models or launching services can expose a host to unexpected code paths, data flow, or resource consumption.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

A skill that advertises local/offline deployment but actually performs different runtime behavior creates a trust and transparency problem. In a security context, undeclared behavior such as downloading extra models or launching services can expose a host to unexpected code paths, data flow, or resource consumption.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A skill that advertises local/offline deployment but actually performs different runtime behavior creates a trust and transparency problem. In a security context, undeclared behavior such as downloading extra models or launching services can expose a host to unexpected code paths, data flow, or resource consumption.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. 配置文件:`package.json`, `tsconfig.json`, `tsconfig.node.json`, `vite.config.ts`, `tailwind.config.js`, `postcss.config.js`, `index.html`, `.gitignore`, `LICENSE

Ssd 1

High
Category
Not specified by scanner
Confidence
90% confidence
Finding

Untrusted transcript text is inserted directly into the LLM translation prompt, so spoken or user-supplied content can contain adversarial instructions such as telling the model to ignore prior directions, alter output structure, or leak surrounding prompt context. In this implementation the impact is limited because the model is used for text generation only and is not connected to tools, but it can still corrupt translations, break line alignment, and produce unsafe or misleading output.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs the agent to use shell and network-capable actions such as pip/npm installation, chmod, model downloads, and service launch, yet it declares no explicit tool scope or permission boundaries. This increases the chance of over-privileged execution and makes it harder for reviewers or runtime policy to constrain destructive or networked behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill emphasizes 'zero network access' for obtaining the project, but its workflow still requires internet access for pip/npm dependencies and large model downloads. This can mislead users into running the skill in restricted or sensitive environments under a false assumption of offline safety, potentially violating network policy and pulling unreviewed third-party artifacts.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation materially understates network requirements by implying the setup is obtainable without network access, then later instructing dependency and model downloads. Such inconsistencies are risky because operators may approve execution based on incomplete threat assumptions, especially where external downloads are prohibited or must be pre-reviewed.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Defaulting to this skill for broad requests like 'deploy audio2srt' can trigger shell execution, file creation, package installation, and service launch without sufficiently specific user intent. Over-broad trigger routing is dangerous because users may invoke a high-impact automation path when they only wanted information, comparison, or a safer alternative.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The workflow includes potentially destructive overwrite behavior for an existing non-empty directory, but this risk is not surfaced prominently in the initial description. In a code-generation/deployment skill, insufficient upfront warning can lead to accidental deletion or replacement of valuable local files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file directs the agent to create directories, write multiple files into TARGET_DIR, and run chmod on a script, all of which modify the user's filesystem. The instructions do not include any warning or disclosure about these side effects or their impact on existing files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The component’s docstring and user-facing strings are written entirely in Chinese, and there is no indication that the skill offers a language choice or that it is intentionally limited to a Chinese-speaking locale. This can violate a language/locale policy when users are not given an opt-in or alternative language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The dropzone instructions and status messages shown to users are all hard-coded in Chinese, which enforces a specific language for interaction. Without an explicit opt-in, fallback language, or documented regional scope, this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code includes natural-language content that is exclusively in Chinese, starting with the component docstring and continuing throughout user-facing labels. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is documented and justified, which is not evident in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The application title and subtitle strings are hardcoded in Chinese, and this file shows no option for users to choose another language. Because these are core UI elements, they indicate the skill experience is language-constrained by default rather than based on user preference.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This component presents all user-facing labels, tooltips, status text, and action names in Chinese, including strings like '翻译为中文', '任务进行中,请等待完成...', and '另存为 SRT'. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the restriction is explicitly justified, which is not shown in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing natural language that forces a specific language/locale, beginning with the component doc comment and continuing throughout labels such as '转录参数设置', '后端 API 地址', and other Chinese-only strings. Under the policy, locale-specific language is a finding unless the skill offers user opt-in or clearly documents a justified regional constraint, which is not present here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code uploads user-provided files to a backend via apiUploadFile, and elsewhere sends transcription segments/subtitle batches to apiTranslate, but the file provides no confirmation prompt or user-facing notice before transmitting that data. Because these operations can expose user content to a local or configured backend service, they merit an explicit warning unless covered elsewhere in skill documentation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The translateTask flow forces the target language to 'zh' instead of using a user-selected setting, which imposes a specific locale/language behavior. The policy allows locale constraints only when users are offered a choice or the constraint is clearly justified; neither is evident here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The function uploads a user-provided File object to a remote backend via fetch, which is a privacy-relevant network transmission. Although the function has an internal comment, there is no user-facing disclosure, confirmation, or warning in this file about sending local audio content to the server.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

All user-facing strings in the script are written in Chinese, including status messages, prompts, and instructions. This imposes a specific language on users without opt-in or any documented justification that the skill is intended only for a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
92% confidence
Finding

The code invokes an external binary (afconvert) on user-controlled file input. Although it uses an argument list rather than a shell string, reducing classic shell-injection risk, it still expands the attack surface to a native parser/converter and uses tempfile.mktemp, which is insecure and can enable race/symlink attacks on the temporary output path. In a network-exposed service that accepts arbitrary uploads or paths, this is a real security concern.

Content

Scanner excerpt · references/transcribe_server.py (reported line 42)May include surrounding context.

python
# 用 macOS 内置 afconvert 转换
    tmp_wav = tempfile.mktemp(suffix=".wav")
    try:
        subprocess.run(
            ["afconvert", "-f", "WAVE", "-d", "LEI16", audio_path, tmp_wav],
            check=True, capture_output=True, text=True,
        )

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The translation prompt and system instruction are hard-coded in Chinese and require the model to act as a Chinese-language translation assistant. This imposes a specific language/locale behavior on users without offering any opt-in or alternative locale selection, which matches the policy category for language/locale violations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The /api/transcribe endpoint accepts an arbitrary file_path from the request body and only checks that the file exists. This allows a remote caller to cause the server to open and process any local file readable by the service account, which can expose sensitive local data through metadata, errors, or extracted content if non-audio files or private recordings are targeted. In a tool advertised as local-use, this becomes more dangerous because operators may assume it is safe to run near sensitive files.

Content

No source excerpt is available for this finding.