Back to skill

Security audit

Ms Qwen Vl

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated purpose as a ModelScope vision API helper, with privacy and dependency cautions but no hidden or destructive behavior found.

Before installing, treat this as a remote API skill: do not submit images containing secrets, personal data, regulated records, or confidential business material unless ModelScope use is approved. Install it in an isolated environment, pin or lock dependency versions, and fix the .env path/setup mismatch so the API key is stored where the script actually reads it.

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
requirements.txt:5
Finding

Unbounded Third-Party Dependency Versions Permit Unreviewed Package Updates

Content
View full analysis

Vulnerability Details

File Location: requirements.txt, lines 5-11
Vulnerability Type: Unpinned third-party dependencies
Risk Level: Medium

Vulnerable Code:

text
openai>=1.0.0

# Image processing library
Pillow>=9.0.0

# Environment variable loading
python-dotenv>=1.0.0

Technical Analysis

Each dependency has only a minimum version constraint and no upper bound, exact version, lock file, or integrity hash. Consequently, installation can resolve to any future release satisfying the constraint without that release having been reviewed with the Skill.

This weakens build reproducibility and exposes installation to supply-chain risk. If an upstream project, maintainer account, release process, or package-distribution channel is compromised, a malicious future version could be selected automatically. Python packages may execute code through build backends during installation and through imported package code at runtime.

No evidence indicates that the currently named packages are malicious or that dependency confusion or typosquatting is presently occurring. The risk arises from automatically trusting future, unreviewed releases.

Attack Path

  1. An attacker compromises an upstream dependency, maintainer account, build pipeline, or package publication process.
  2. The attacker publishes a malicious release whose version satisfies one of the unrestricted constraints.
  3. A user runs pip install -r requirements.txt in an environment where that release is selected.
  4. Pip downloads and installs the unreviewed package.
  5. Malicious code executes during package build or installation, or later when openai, PIL, or dotenv is imported.
  6. The code operates with the permissions of the user or service account performing installation or running the Skill.

Impact Assessment

Successful exploitation could permit arbitrary code execution with the privileges of the installing o ...[truncated 495 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to an explicitly reviewed version, for example:

    text
    openai==<reviewed-version>
    Pillow==<reviewed-version>
    python-dotenv==<reviewed-version>
    
  2. Generate and commit a lock file containing all transitive dependencies.

  3. Require package hashes during installation, such as through a hash-pinned requirements file and pip install --require-hashes.

  4. Install packages only from an approved package index over TLS, and configure index sources explicitly in CI.

  5. Use an automated dependency-update process that creates reviewed pull requests rather than accepting new versions automatically.

  6. Run vulnerability and provenance checks on direct and transitive dependencies before release.

  7. Perform dependency installation and Skill execution in a least-privileged, isolated environment without unnecessary credentials or filesystem access.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (21)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

pip install -r requirements.txt

配置 API Key

cp scripts/.env.example scripts/.env

text

编辑 `scripts/.env` 文件,填入从 https://modelscope.cn/my/myaccesstoken 获取的 API Key:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

pip install -r requirements.txt

配置 API Key

cp scripts/.env.example scripts/.env

text

编辑 `scripts/.env` 文件,填入从 https://modelscope.cn/my/myaccesstoken 获取的 API Key:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ms_qwen_vl.py (reported line 26)May include surrounding context.

python
from PIL import Image

# 加载环境变量
dotenv.load_dotenv(Path(__file__).parent / ".env")

# 默认配置
DEFAULT_API_KEY = os.getenv("MODELSCOPE_API_KEY", "")

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/ms_qwen_vl.py (reported line 105)May include surrounding context.

python
raise ValueError("--question 参数在 ask 任务中是必需的")
        return question

    return prompts.get(task, prompts["describe"])


def analyze_image(

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README clearly states this skill uses a remote ModelScope Qwen3-VL API and supports local images and URLs, but it does not warn that image contents will be uploaded to an external third-party service. In a multimodal vision skill, this omission is security-relevant because users may submit sensitive screenshots, documents, IDs, or internal images without realizing they leave the local environment.

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 run local Python code, read local image files, access environment-based API credentials, and potentially write files, but it does not declare any explicit tool scope or permissions boundaries. This increases the chance of unintended tool use and makes review and runtime enforcement weaker, especially when handling user-supplied paths and external API calls.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger conditions are broad and keyword-based, including generic terms like ModelScope, Qwen-VL, and image parsing. Overbroad activation can cause the skill to run in contexts the user did not intend, which is risky here because the skill may process local files and transmit content to a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill clearly directs users to process local images and URLs through a script that submits data to the external ModelScope API, but it does not prominently disclose that image contents and possibly embedded sensitive information will leave the local environment. In a multimodal/OCR context, screenshots, invoices, and desktop images often contain credentials, personal data, or internal business information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The guide demonstrates sending an image URL and user prompt to a third-party remote API but does not warn that image content and associated text leave the local environment. This can cause users to unknowingly transmit sensitive images, OCR-able documents, or confidential prompts to an external service, creating privacy, compliance, and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The local-image section makes the risk less obvious because it presents local file handling and base64 encoding as a convenience step, but that encoded content is still prepared for upload to the remote multimodal API. Users may incorrectly assume processing is local-only and accidentally exfiltrate sensitive files such as screenshots, IDs, contracts, or internal diagrams.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script base64-encodes local image contents and transmits them to a remote ModelScope API, but provides no explicit warning, consent prompt, or privacy notice to the user. This can expose sensitive local image data, including screenshots, documents, IDs, or embedded metadata, to an external service unexpectedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

该文件的触发描述、使用说明和对话示例均默认并强制采用中文表述,没有说明可根据用户语言偏好切换输出语言。若组织要求尊重用户语言/区域选择,这种单一语言约束可能构成自然语言策略问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file presents all user-facing instructions and examples only in Chinese, with no opt-in or alternative language option. Under the language/locale policy rule, forcing a specific language without user choice can be a policy violation unless the regional constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified with a lower bound only, so builds may resolve to different versions over time. This weakens supply-chain control and can unintentionally introduce vulnerable or breaking releases into the skill environment.

Content

Scanner excerpt · requirements.txt (reported line 5)May include surrounding context.

text
# 安装方式: pip install -r requirements.txt

# OpenAI SDK (用于调用 ModelScope API)
openai>=1.0.0

# 图像处理库
Pillow>=9.0.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

Pillow is unpinned, which means installations can fetch any newer version satisfying the constraint. Because this skill processes images, an unexpected vulnerable Pillow release could increase exposure to parser-related issues and make behavior non-reproducible.

Content

Scanner excerpt · requirements.txt (reported line 8)May include surrounding context.

text
openai>=1.0.0

# 图像处理库
Pillow>=9.0.0

# 环境变量加载
python-dotenv>=1.0.0

Unverifiable Dependency: Pillow has 16 known advisory(ies) (CVE-2016-2533 (Pillow buffer overflow in ImagingPcdDecode); CVE-2023-50447 (Arbitrary Code Execution in Pillow); CVE-2021-27922 (Pillow Uncontrolled Resource Consumption) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The manifest does not pin Pillow, so it is impossible to verify whether the deployed version is affected by known advisories. In this skill's context, Pillow handles image content, so any vulnerable image-decoding version could be exposed to untrusted user-supplied files and increase the risk beyond a generic library issue.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

python-dotenv is also specified as a minimum version only, leaving dependency resolution open-ended. This can pull in unintended versions, including ones later found vulnerable, reducing reproducibility and supply-chain assurance.

Content

Scanner excerpt · requirements.txt (reported line 11)May include surrounding context.

text
Pillow>=9.0.0

# 环境变量加载
python-dotenv>=1.0.0

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
78% confidence
Finding

Because python-dotenv is not pinned, the actual installed release cannot be checked conclusively against known advisories. The library is typically used only at startup for environment loading, so the direct exposure in this skill is lower than for image parsing, but it still represents avoidable supply-chain uncertainty.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The stated purpose is to perform multimodal visual parsing via the ModelScope API. While using an API key is expected, silently reading configuration and secrets from a colocated .env file is an additional capability not justified or disclosed by the manifest text.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The task prompts and multiple CLI/user-visible strings are written only in Chinese, which effectively forces a specific language for interactions and outputs. The file does not provide an opt-in language selection or explain that the tool is intentionally limited to a Chinese-language context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes a visual analysis skill that calls the ModelScope Qwen3-VL API for image understanding tasks. However, the implementation also includes a general-purpose local file write capability through --output, which is not mentioned in the manifest description and goes beyond pure analysis behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.