Back to skill

Security audit

Simple sound-to-text skill locally

Security checks for vulnerabilities and agentic risk

Overview

This local transcription skill matches its stated purpose, but it needs review because its session ID handling can write transcript files outside the intended folder and its installer makes broad host changes.

Install only if you trust the publisher and can run it in a constrained environment. Avoid arbitrary or user-controlled session_id values, prefer an unprivileged runtime account, and pin dependencies before production use. Treat generated transcripts as sensitive local data.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/stt_simple.py:39
Finding
Unvalidated Session Identifier Allows Transcript Writes Outside the Intended Output Directory## Vulnerability Details **File Location**: `scripts/stt_simple.py`, lines 39-55; attacker-controlled input originates at line 74 **Vulnerability Type**: Path traversal and arbitrary file placement **Risk Level**: High **Vulnerable Code**: ```python # Determine output directory based on session_id if session_id: # Use session-specific subdirectory for multi-Agent isolation output_dir = os.path.join(BASE_OUTPUT_DIR, session_id) else: # Default shared directory output_dir = BASE_OUTPUT_DIR os.makedirs(output_dir, exist_ok=True) # Generate unique filename with timestamp to avoid collisions base_name = Path(audio_path).stem timestamp = uuid.uuid4().hex[:8] output_txt = os.path.join(output_dir, f"{base_name}_{timestamp}.txt") with open(output_txt, "w", encoding="utf-8") as f: f.write(result["text"]) ``` The value used by this code is obtained directly from the command line: ```python session_id = sys.argv[4] if len(sys.argv) > 4 else None ``` ### Technical Analysis The `session_id` argument is used as a filesystem path component without validation or canonical-path containment checks. Python's `os.path.join()` does not guarantee that the resulting path remains beneath `BASE_OUTPUT_DIR`. A session identifier containing parent-directory segments, such as `../../other-directory`, can traverse outside the intended output directory. If `session_id` is an absolute path, `os.path.join(BASE_OUTPUT_DIR, session_id)` discards the base path entirely and returns the absolute path. The program subsequently calls `os.makedirs()` on the resulting path and writes the transcript to it. The randomized filename suffix limits deterministic replacement of a specific existing file, but it does not prevent arbitrary directory creation or placement of attacker-influenced transcript data in unintended filesystem locations. ### Attack Path 1. An attacker or untrusted caller supplies a valid audio f ...[truncated 1347 chars]
Remediation
## Remediation Suggestions - Restrict `session_id` to a conservative identifier format, for example `^[A-Za-z0-9_-]{1,64}$`. - Reject absolute paths, path separators, `.` components, and `..` components. - Resolve both the base directory and candidate directory to canonical paths, then verify that the candidate remains beneath the base directory before creating it. - Use `pathlib.Path` containment checks rather than relying only on string-prefix comparisons. - Run the transcription process under a dedicated unprivileged account with write access limited to the transcript directory. - Set restrictive output permissions and consider per-session access controls because transcripts may contain sensitive information. - Add tests covering absolute paths, parent traversal, nested traversal, symlink traversal, empty identifiers, and excessively long identifiers. Example hardening approach: ```python import re from pathlib import Path base_dir = Path(BASE_OUTPUT_DIR).resolve() if session_id: if not re.fullmatch(r"[A-Za-z0-9_-]{1,64}", session_id): raise ValueError("Invalid session identifier") output_dir = (base_dir / session_id).resolve() if output_dir.parent != base_dir: raise ValueError("Session directory escapes output root") else: output_dir = base_dir ```

T08 · Insecure Dependencies

Warning
Location
scripts/install.sh:78
Finding
Unpinned Python Dependencies Create a Mutable Installation Supply Chain## Vulnerability Details **File Location**: `scripts/install.sh`, lines 78-79 **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium **Vulnerable Code**: ```bash "$VENV_DIR/bin/pip" install --upgrade pip "$VENV_DIR/bin/pip" install openai-whisper ``` ### Technical Analysis The installation script upgrades `pip` and installs `openai-whisper` without specifying reviewed versions or cryptographic hashes. Package resolution therefore depends on mutable package-index state at installation time. Transitive dependencies are also unconstrained. This makes installations non-reproducible and allows future package releases, compromised releases, altered transitive dependencies, or package-index compromise to change the code installed and executed without any corresponding change to the audited Skill files. Python package installation can execute build-system code during source distribution processing. Installed packages are also imported and executed later by the Skill. Consequently, a compromised dependency can obtain code execution with the privileges of the user running `install.sh` or the transcription process. No evidence was found that the currently named `openai-whisper` package is malicious. The vulnerability is the unsafe, mutable dependency resolution process rather than a confirmed malicious package. ### Attack Path 1. An operator runs `scripts/install.sh`. 2. The script contacts the configured Python package index and resolves the latest available `pip`, `openai-whisper`, and transitive dependencies. 3. A compromised, malicious, or unexpectedly incompatible release is selected because no approved version or hash is enforced. 4. Package build or installation logic executes during installation, or malicious code executes when `whisper` is imported. 5. The dependency gains the privileges and filesystem or network access available to the installer or runtime account. ### Impact A ...[truncated 626 chars]
Remediation
## Remediation Suggestions - Pin `pip`, `openai-whisper`, and every transitive dependency to reviewed versions. - Generate and commit a lock file from a trusted environment. - Enforce package hashes, such as through a requirements file used with `pip install --require-hashes`. - Avoid automatically upgrading `pip` during routine Skill installation. - Prefer prebuilt, reviewed artifacts from a controlled package repository. - Verify package provenance and integrity before deployment. - Separate system dependency installation from application setup and require explicit administrative approval for host package-manager operations. - Perform dependency vulnerability scanning and periodic controlled updates rather than resolving mutable latest releases on every installation. - Execute installation with the minimum privileges necessary and run transcription under a dedicated unprivileged account.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### 重新安装 / Reinstall
```bash
rm -rf /root/.openclaw/venv/stt-simple
/root/.openclaw/workspace/skills/stt-simple/scripts/install.sh
```
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### 重新安装 / Reinstall
```bash
rm -rf /root/.openclaw/venv/stt-simple
/root/.openclaw/workspace/skills/stt-simple/scripts/install.sh
```
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill documents file-writing behavior by directing output into `/root/.openclaw/workspace/stt_output/...` but does not declare any corresponding tool scope such as permissions or allowed-tools. This creates a least-privilege gap: an agent may invoke file-writing behavior without explicit policy visibility, increasing the chance of unintended writes or abuse through crafted filenames/session IDs.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill hard-codes `agent-jari-whatsapp` as the current session identity and default output directory, tying the skill to a specific named agent/channel context. In a multi-agent environment this can cause cross-session data mixing, privacy leakage, and accidental access to another agent's transcription outputs if operators reuse the documented default.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The function signature sets `language` to `"zh"` by default, which imposes a specific locale when the caller does not choose one. This is a natural-language policy concern because the skill defaults to a language preference rather than offering a neutral default or requiring explicit user selection.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The code concatenates user-controlled session_id directly into the output path without validation or normalization. An attacker can supply path traversal values such as '../' or absolute-like components to escape the intended base directory, undermining the claimed session isolation and potentially writing transcription output into unintended filesystem locations accessible to the process.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The comments and feature description claim multi-agent isolation, but the implementation does not enforce isolation boundaries beyond placing files in a subdirectory named by untrusted input. This can create a false security assumption for integrators, and combined with the unvalidated session_id, one agent may interfere with another agent's output location.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The user-facing help text and argument parsing state that the default language is `zh`, and the CLI applies that default when no language is provided. This forces a specific language/locale without user opt-in, which matches the policy-violation category for locale constraints.

Static analysis

Detected: suspicious.destructive_delete_command

Documentation contains a destructive delete command without an explicit confirmation gate.

Warn
Code
suspicious.destructive_delete_command
Location
SKILL.md:108