Back to skill

Security audit

asr-service

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its speech-to-text purpose, but users should review it because sensitive audio is uploaded to a configurable HTTP endpoint and the skill can switch/start an ASR service through IFF.

Review the configuration before use, especially `service.base_url`; keep it on a trusted loopback ASR service unless you intentionally approve a remote endpoint. Install in an isolated environment, consider pinning dependencies, and avoid transcribing sensitive recordings unless you trust the configured ASR service and its logs/retention behavior.

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)

T08 · Insecure Dependencies

Warning
Location
README.md:53
Finding

Unpinned Third-Party Dependencies in Installation Instructions

Content
View full analysis

Vulnerability Details

File Location: README.md:53 and README.md:62
Vulnerability Type: Supply-chain exposure through mutable dependency resolution
Risk Level: Medium

Vulnerable Code

bash
pip install "funasr>=1.4.1" modelscope httpx pyyaml
bash
pip install inferfabric

Technical Analysis

The documented installation process installs multiple third-party packages without exact version constraints or integrity hashes. The funasr constraint accepts any release at or above version 1.4.1, while modelscope, httpx, pyyaml, and inferfabric have no version constraints.

Consequently, the effective code installed by users can change after this skill has been reviewed. Package installation can execute package-controlled build hooks, and imported dependencies execute with the privileges of the user running the skill. This creates exposure to compromised package releases, malicious transitive dependencies, unexpected dependency substitutions, and incompatible future versions.

This finding does not establish that any currently named package is malicious. The risk arises from the installation process permitting mutable, unverified dependency resolution.

Attack Path

  1. An attacker compromises the publishing account, distribution process, or dependency chain of one of the referenced packages.
  2. The attacker publishes a malicious version that satisfies the unconstrained or lower-bounded requirement.
  3. A user follows the README installation instructions.
  4. pip resolves and downloads the malicious version because no reviewed lock file, exact version, or hash prevents it.
  5. Attacker-controlled code executes during installation or when the dependency is imported at runtime.

Impact Assessment

Malicious dependency code would generally execute with the operating-system privileges of the user performing the installation or running the ASR skill. Depending on those privilege ...[truncated 305 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to a reviewed exact version rather than using open-ended or lower-bounded constraints.
  2. Generate and distribute a lock file that includes all transitive dependencies.
  3. Record cryptographic hashes and install with pip --require-hashes.
  4. Configure installation to use an explicitly trusted package index and document package provenance.
  5. Run dependency vulnerability and provenance scanning in CI.
  6. Test and review dependency upgrades before updating the lock file.
  7. Recommend installation into an isolated virtual environment under a non-privileged account.

T09 · Insecure Skill Coding Practices

Warning
Location
asr_service/skill.py:29
Finding

Configurable ASR Endpoint Can Receive Sensitive Audio Without Origin Validation

Content
View full analysis

Vulnerability Details

File Location: asr_service/skill.py:29 and asr_service/skill.py:85-100
Vulnerability Type: Unrestricted configurable upload destination and potential server-side request forgery
Risk Level: Medium

Vulnerable Code

python
self._base_url = service.get("base_url", "http://localhost:8881").rstrip("/")
python
base_url = self._iff_manager.ensure_running()

last_error: Exception | None = None
for attempt in range(1, self._max_attempts + 1):
    try:
        with open(audio, "rb") as f:
            resp = httpx.post(
                f"{base_url}/v1/audio/transcriptions",
                files={"file": f},
                data={
                    "model": "sensevoice",
                    "language": language or "auto",
                    "response_format": response_format,
                    **({"spk": "true"} if speaker_labels else {}),
                },
                timeout=120,
            )

Technical Analysis

The skill documentation describes a localhost ASR architecture, but service.base_url is accepted from an arbitrary YAML configuration without validating its scheme, hostname, resolved address, port, or trust level. The complete user-selected audio file is then sent to the configured destination as a multipart upload.

A caller may also provide an alternative configuration through the public ASRSkill(config_path=...) constructor. If configuration integrity is not protected, replacement or modification of the configuration can redirect audio to an attacker-controlled server. The same unrestricted URL behavior can be used to send requests to internal HTTP services reachable from the host.

The default configuration uses http://localhost:8881 and does not itself exfiltrate data. Exploitation requires control over, or influence on, the configuration supplied to the skill.

Attack Path

  1. An attacker modifies `config.yaml ...[truncated 1143 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict service.base_url to loopback addresses by default, including validated forms of localhost, 127.0.0.0/8, and ::1.
  2. Parse URLs with a standard URL parser and reject user-information components, fragments, unsupported schemes, and unexpected ports.
  3. Resolve hostnames and verify every resolved address against an explicit allowlist to mitigate DNS-based bypasses.
  4. Require a separate, clearly named opt-in such as allow_remote_service: true before permitting non-loopback endpoints.
  5. Require HTTPS with certificate verification for explicitly authorized remote services.
  6. Protect configuration files with appropriate ownership and filesystem permissions.
  7. Display or log the destination origin before uploading sensitive audio, without logging the audio contents.
  8. Consider adding endpoint authentication and integrity controls so a service cannot be trusted solely because /health returns HTTP 200.
  9. Add tests covering external hosts, alternative loopback representations, redirects, embedded credentials, and hostname-resolution changes.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description and documentation are presented in Chinese, beginning with 中文语音识别技能, without indicating that other documentation languages are available or that Chinese is a required locale. Under the policy, forcing a specific language without user opt-in can be a natural-language locale violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 51)May include surrounding context.

bash
# 1. 创建 Conda 环境 + 安装 FunASR
conda create -n sensevoice python=3.12 -y
conda activate sensevoice
pip install "funasr>=1.4.1" modelscope httpx pyyaml

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 51)May include surrounding context.

bash
# 1. 创建 Conda 环境 + 安装 FunASR
conda create -n sensevoice python=3.12 -y
conda activate sensevoice
pip install "funasr>=1.4.1" modelscope httpx pyyaml

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises capabilities consistent with environment access, file writing, network calls, and shell execution, but it does not declare any explicit tool scope or permissions boundary. That creates a least-privilege failure: operators and users cannot accurately assess what the skill may access, increasing the chance of unintended file, network, or command execution in downstream implementations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill documentation does not clearly warn users that provided audio files are transmitted over HTTP to a separate local ASR service for processing. Even though the endpoint is localhost, this is still a data-flow and privacy boundary; sensitive audio may be exposed to another process, logged, retained, or handled by a differently secured component without the user's informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The module docstrings and operational messages are written in Chinese, which indicates a fixed language choice in user-visible or maintainer-facing text without any sign of user language selection or justification. Under the stated policy, forcing a specific language without opt-in can be a locale-policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code automatically invokes iff switch to change the active ASR service when the health check fails. Although there is an internal log entry, there is no user-facing disclosure or confirmation before performing this potentially state-changing system operation.

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 · asr_service/iff_manager.py (reported line 39)May include surrounding context.

python
return self._base_url

        log.info("ASR service not healthy, switching via IFF: %s", self._service_name)
        result = subprocess.run(
            ["iff", "switch", self._service_name],
            capture_output=True,
            text=True,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest describes an ASR service providing speech recognition, speaker diarization, subtitles, and IFF-hosted deployment. While health-checking the local ASR endpoint is expected, invoking an external iff switch command gives this code deployment/orchestration control rather than just ASR functionality, which is not clearly justified by the stated skill purpose itself.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The transcribe method opens a user-supplied audio file and sends it via httpx.post to the ASR service endpoint. While this network transmission is central to the skill's purpose, the code file contains no confirmation prompt or user-facing disclosure that local audio data will be sent to a service endpoint, which matters for privacy-sensitive audio content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The markdown documents user-facing operations like transcribing audio and generating SRT/VTT output, and the architecture section shows requests are sent via HTTP to http://localhost:8881/v1/audio/transcriptions. However, there is no explicit user warning about audio data being transmitted to a running service process for processing, which is a privacy-relevant behavior for a skill handling user media.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language documentation and interface description are presented entirely in Chinese, which can amount to a language/locale policy issue when no user choice or opt-in is offered. Although the model supports multiple transcription languages, the skill documentation itself does not state that Chinese is an intentional, region-specific constraint or provide an alternative language option.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring and exception docstrings are written only in Chinese (e.g. "ASR-Service 异常", "ASR 服务不可用", "转写失败"). Under the stated policy, forcing a specific language without user opt-in or documented justification can be a natural-language policy violation, and this file provides no indication that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The module docstring and multiple function/class docstrings are written entirely in Chinese, indicating a fixed language choice in user-facing or maintainer-facing natural language without any opt-in or alternative locale. The policy explicitly calls out language or locale constraints as findings when the skill does not offer a choice or justify the restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

Multiple docstrings and comments are written in Chinese, such as the module and class descriptions, without any indication that the skill is intentionally restricted to Chinese-language users or documentation. This can violate a language/locale policy when no user opt-in or documented justification is provided.

Content

No source excerpt is available for this finding.