Back to skill

Security audit

feishu-asr

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be for voice transcription, but it gives users conflicting privacy and network expectations around chat audio, cloud services, credentials, and model downloads.

Review carefully before installing. Do not treat this as offline-only: it may download Whisper models from a Hugging Face mirror, and the README describes cloud ASR providers that may receive voice audio. Only use it with Feishu and cloud credentials you are comfortable granting, and prefer a pinned, locally cached model and explicit privacy controls for sensitive chat audio.

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

T08 · Insecure Dependencies

Warning
Location
scripts/recognize.py:8
Finding

Unpinned Dependencies and Unverified Model Downloads

Content
View full analysis

Vulnerability Details

File Location: scripts/recognize.py:8-8, scripts/recognize.py:18-18, scripts/recognize.py:35-35, scripts/recognize.py:47-52, SKILL.md:37-50, SKILL.md:63-63
Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

Vulnerable Code

scripts/recognize.py:

python
# Dependencies:
#     pip install torch transformers soundfile
python
# Use a mirror to resolve network problems
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
python
if sr != 16000:
    import resampy
    audio = resampy.resample(audio, sr, 16000)
python
model_name = f'openai/whisper-{model_size}'

print(f'Loading {model_size} model...')
processor = WhisperProcessor.from_pretrained(model_name)
model = WhisperForConditionalGeneration.from_pretrained(model_name)
feature_extractor = WhisperFeatureExtractor.from_pretrained(model_name)

SKILL.md:

python
import os
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'

from transformers import WhisperForConditionalGeneration, WhisperProcessor, WhisperFeatureExtractor
import soundfile as sf

processor = WhisperProcessor.from_pretrained('openai/whisper-tiny')
model = WhisperForConditionalGeneration.from_pretrained('openai/whisper-tiny')
feature_extractor = WhisperFeatureExtractor.from_pretrained('openai/whisper-tiny')
bash
pip install torch transformers soundfile

Technical Analysis

The installation instructions resolve torch, transformers, and soundfile without pinned versions or package hashes. Dependency resolution can therefore select different releases over time, and the exact code installed by users cannot be reproduced or verified against the audited project.

The executable also imports resampy when input audio does not use a 16-kHz sample rate, but this package is absent from the documented installation command. Users attempting to resolve the resu ...[truncated 3152 chars]

Remediation
View remediation

Remediation Suggestions

  1. Create a lock file or fully pinned requirements file covering all direct and transitive dependencies, including resampy.
  2. Require package hashes during installation, such as with pip install --require-hashes -r requirements.txt.
  3. Generate and review the lock file from a trusted package index in a controlled build environment.
  4. Avoid unconditionally replacing HF_ENDPOINT. Prefer the official Hugging Face endpoint or a controlled internal artifact registry whose synchronization and integrity controls are documented.
  5. Pin the model to an audited immutable commit revision:
    python
    MODEL_REVISION = "<audited-commit-hash>"
    processor = WhisperProcessor.from_pretrained(
        model_name,
        revision=MODEL_REVISION,
    )
    model = WhisperForConditionalGeneration.from_pretrained(
        model_name,
        revision=MODEL_REVISION,
        use_safetensors=True,
    )
    feature_extractor = WhisperFeatureExtractor.from_pretrained(
        model_name,
        revision=MODEL_REVISION,
    )
    
  6. Pre-download model artifacts during a controlled installation step, verify them against documented SHA-256 checksums, and use local_files_only=True during normal transcription.
  7. Keep remote custom model code disabled and prefer safetensors weights where available.
  8. Correct the offline-use claim. Clearly disclose any first-run network access, the destination contacted, the approximate download size, and how users can deploy verified artifacts for fully offline operation.
  9. Run dependency and model processing inside a least-privileged environment or container with restricted filesystem and network access.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README contradicts the skill metadata by documenting use of Feishu app credentials and third-party cloud ASR providers despite the manifest claiming a fully local, offline, no-registration Whisper workflow. This discrepancy can mislead users into granting message-read permissions and transmitting audio off-device under false privacy and trust assumptions, which is a meaningful security and privacy issue.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest context advertises local Whisper/offline operation, but the README explicitly instructs users to configure Alibaba Cloud or Tencent Cloud ASR and describes a workflow that sends voice data to external services. In a skill that processes chat voice messages, this mismatch is especially dangerous because users may assume sensitive content remains local when it is actually uploaded to third parties.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims it is offline and does not require networking, but the implementation explicitly sets a Hugging Face mirror and notes that models are downloaded on first run. It also claims Feishu voice-message handling, while the code only processes a local audio file, which is a material behavior mismatch that can mislead deployment decisions and user trust.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The module-level documentation says the skill is offline and does not need internet, while the same file states that the first run auto-downloads models and sets HF_ENDPOINT to an online mirror. This inconsistency is security-relevant because users and host systems may rely on the offline claim when deciding whether the skill is safe to execute in restricted or sensitive environments.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill claims it works offline and does not require networking, but it explicitly configures a remote Hugging Face mirror and loads models with from_pretrained, which will download model artifacts if they are not already cached. This creates a trust and privacy boundary violation: running the skill can unexpectedly initiate outbound network access, leak usage metadata, and fetch unpinned remote content despite the offline claim.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README describes downloading Feishu voice messages and using an ASR service provider, but it does not present a clear privacy warning that message audio may be transmitted to external cloud services. Because voice messages often contain sensitive personal or business information, lack of disclosure can lead to unauthorized or unexpected data exposure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill documents environment variable manipulation (HF_ENDPOINT) and model-loading behavior but declares no explicit tool scope or permissions. This creates a transparency and policy-gap issue: operators and users cannot accurately assess that the skill may alter runtime behavior and trigger external model-fetch logic.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Claiming no network requirement while the documented implementation downloads models from remote infrastructure is a supply-chain and disclosure risk. In restricted or sensitive environments, this can violate network policy, unexpectedly leak metadata, or fetch unreviewed artifacts at runtime.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation simultaneously claims offline operation and instructs use of a remote mirror for model download, creating contradictory security expectations. This is dangerous because reviewers may approve or run the skill under a false assumption that no outbound connections will occur.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

该 markdown 文件适用 SQP-1。L11-L12 将“要求将语音转为文字”“提到‘语音识别’、‘转文字’”列为触发条件,但未限定必须是飞书语音消息场景,也没有排除性示例,容易与普通讨论语音识别或转写需求的对话重叠。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill does not clearly warn users that remote model download or mirror access may occur, despite emphasizing offline use. This undermines informed consent and can lead to unexpected outbound traffic, policy violations, or exposure to remote artifact sourcing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and all CLI messages are written only in Chinese, which effectively forces a specific language for user interaction. There is no opt-in, fallback, or documentation indicating that the skill is intentionally region-specific, so this appears to violate the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The README content is entirely in Chinese and does not indicate that the skill is region-specific or provide an opt-in language/locale choice. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

SQP-3 适用于所有文件类型。该技能说明全文以中文固定描述和触发方式呈现,没有说明是否支持其他语言或允许用户选择输出语言,可能构成默认强制特定语言/locale 的政策问题。

Content

No source excerpt is available for this finding.