Back to skill

Security audit

hidream-model-gen

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its Vivago image/video generation purpose, but it needs Review because token handling is under-scoped and some adult audio/video template behavior is not clearly disclosed.

Install only if you are comfortable sending prompts, images, and generation metadata to Vivago using your account token. Do not use an untrusted custom ports configuration, rotate the Vivago token if one may have been exposed, and review or remove the adult template data if the skill will be used in a general or policy-restricted environment.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/vivago_client.py:65
Finding

Configurable API Host Can Receive the Vivago Bearer Token

Content
View full analysis
Dict: try: if config_path: with open(config_path, 'r', encoding='utf-8') as f: return json.load(f) else: return load_ports_config() ``` ```python try: url = f"{self.base_url}{endpoint}" headers_post = {**self.headers, "Content-Type": "application/json"} response = requests.post( url, json=data, headers=headers_post, timeout=1800 ) ``` ### Technical Analysis The API client accepts an arbitrary configuration file through `ports_config_path`. The file can define `base_url`, which is used directly to construct API request URLs. The client does not verify that the configured URL: - Uses HTTPS. - Belongs to `vivago.ai` or an explicitly trusted subdomain. - Has no embedded credentials or unexpected port. - Resolves to a non-local, trusted destination. Every generated request includes the Vivago bearer token through the `Authorization` header. Therefore, control over the configuration path or contents is sufficient to redirect au ...[truncated 1345 chars]
Remediation
View remediation
str: parsed = urlparse(url) if parsed.scheme != "https": raise ValueError("The API base URL must use HTTPS") if parsed.hostname not in ALLOWED_API_HOSTS: raise ValueError("Untrusted API host") if parsed.username or parsed.password: raise ValueError("Embedded URL credentials are prohibited") return url.rstrip("/") ``` 2. Validate endpoint fields and require them to be relative paths beginning with a single `/`. Reject absolute URLs, network-path references, backslashes, fragments, and traversal components. 3. Do not forward credentials to custom hosts. If custom endpoints are genuinely required, make credential forwarding a separate explicit option that defaults to disabled. 4. Prefer removing `ports_config_path` from untrusted entry points and package reviewed endpoint definitions as immutable application data. 5. Add tests confirming that HTTP URLs, unrelated domains, localhost, IP literals, and absolute endpoint URLs are rejected. 6. Rotate any Vivago token that may already have been used with an untrusted configuration. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/vivago_client.py:977
Finding

Bearer Token Is Unnecessarily Sent During Image Downloads

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Open-Ended and Unhashed Dependencies Prevent Reproducible Installation

Content
View full analysis
=2.31.0 Pillow>=10.0.0 # Replaces opencv-python for lighter image processing tqdm>=4.66.0 # For progress bars # Configuration python-dotenv>=1.0.0 # Testing pytest>=7.4.4 pytest-cov>=4.1.0 responses>=0.24.1 # Code quality black>=23.12.1 flake8>=7.0.0 mypy>=1.8.0 # Type stubs for better IDE support types-requests>=2.31.0 ``` ### Technical Analysis Every dependency uses an open-ended lower bound. Consequently, `pip install -r requirements.txt` may install any future compatible version rather than the versions reviewed during this audit. The file also mixes runtime packages with testing, formatting, linting, and type-checking tools, unnecessarily increasing the installation and dependency graph. No package in the observed file is an evident typosquat or malicious package. The risk arises from the absence of exact reviewed versions and integrity hashes, not from a confirmed malicious dependency. Without a lock file or hashes, installation results can change over time. A compromised future release, malicious transitive dependency, or incompatible update could therefore execute code during package installation or when imported by the Skill. ### Attack Path 1. A direct or transitive dependency publishes a compromised future version that still satisfies the declared lower bound. 2. A user follows the documented `pip install -r requirements.txt` installation procedure. 3. The package resolver selects the compromised version because no upper bound, lock file, or hash prevents it. 4. Malicious build hooks, installation code, or imported runtime code executes under the privileges of the installing or running user. This is a conditional supply-chain path; the audit found no evidence that the currently named packages are intentional ...[truncated 562 chars]
Remediation
View remediation
=` constraints. 3. Generate and enforce cryptographic hashes, for example with `pip-tools` and `pip install --require-hashes`. 4. Review and lock transitive dependencies, not only direct dependencies. 5. Install only runtime packages in production environments. 6. Use automated dependency scanning and controlled update workflows so version changes are reviewed and tested before release. 7. Prefer isolated virtual environments and avoid installing the Skill as a privileged operating-system user. ]]>
Vulnerability Patterns
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (75)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk does not implement the declared media-generation behavior. Its primary purpose is configuration management: locating config files, reading local JSON files, combining category data, and returning cached configuration objects. There is no API call logic, no image/video processing, no Vivago platform integration, and no user-facing generation functionality in this snippet. While configuration loading could be a supporting utility within a larger image/video skill, the supplied chunk itself is materially different from the declared purpose, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says the skill generates images and videos through the Vivago AI platform/API. However, the supplied code chunk only processes local JSON template data: it reads template_list_full.json, tries to fix malformed JSON, extracts fields, writes templates_data.json, and prints statistics. This is a materially different primary purpose from AI media generation. The filesystem access is consistent with a preprocessing/export script, not with the declared end-user capability. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description presents a broad multimodal Vivago generation skill covering several image and video workflows. This specific code chunk, however, is narrowly focused on generating a video from a text prompt, then returning a Vivago media URL and a Feishu-formatted message because Feishu cannot send playable video directly. That Feishu integration behavior is a distinct undeclared capability, and the implemented functionality in this chunk is materially narrower than the declared set of supported generation modes. While the video-generation aspect is consistent with the description at a high level, the code does not substantiate most of the declared capabilities and adds Feishu-specific delivery behavior not mentioned in the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose describes an AI media-generation skill integrated with the Vivago AI platform. The supplied code does not call any external API, does not generate images or videos, and does not implement transformation workflows beyond basic preprocessing. Its actual role is a supporting utility for image upload preparation, which is materially narrower and different from the claimed primary purpose. Therefore, the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose centers on AI image/video generation through the Vivago AI platform, but the code chunk contains only generic logging setup utilities. It does not call any external AI service, process images or videos, handle prompts or media inputs, or implement any generation/transformation workflow. This is a clear description-to-behavior mismatch because the code’s primary purpose is unrelated logging configuration.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill generates images and videos through the Vivago AI platform. However, the actual code only processes a local JSON file containing template information, with fallback regex-based extraction if JSON parsing fails, and prints categorized summaries. This is a materially different primary purpose from media generation. There is no evidence of text-to-image, image-to-image, image-to-video, keyframe-to-video, style transfer, or any network/API usage. Therefore the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a broad Vivago media-generation skill supporting multiple creation modes. The supplied code chunk, however, is a supporting configuration/request-construction component: it loads template definitions, computes endpoints, exposes template metadata, and builds request bodies for effect video generation using an image UUID. There is no code here that sends requests to Vivago, uploads assets, polls results, or implements text-to-image, image-to-image, keyframe-to-video, or style transfer workflows directly. While related to Vivago video templating, its primary purpose is materially narrower and infrastructural, so the description overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This template includes explicit sexualized audio generation ('female moaning') that extends the skill into erotic audio content outside the declared image/video generation purpose. In a general-purpose agent context, that creates a policy and trust-boundary problem: users or downstream systems may invoke undeclared NSFW audio generation without proper consent, moderation, or age gating.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This second template likewise embeds erotic audio generation ('male moaning'), expanding the skill beyond its stated purpose and bypassing user expectations about what content can be produced. The risk is amplified because the capability is hidden in data templates rather than obvious from the manifest, making moderation and review easier to evade.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares access to an environment credential and documents file and network operations, but it does not define an explicit tool/permission scope such as allowed tools or permissions. That increases the risk of overbroad execution in agent environments, especially because the skill can read local files, write outputs, and make authenticated external network requests using HIDREAM_AUTHORIZATION.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The architecture notes are written only in Chinese while the file otherwise contains English keys and values, creating an implicit language requirement for maintainers or tooling users who need to interpret these instructions. Under the language/locale policy, forcing a specific language without opt-in or justification is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The configured API surface exposes text-to-video and large template/effect-generation capabilities that are broader than the skill’s stated description. This mismatch can mislead users, reviewers, or policy enforcement into approving a narrower skill while the implementation can invoke materially different generation flows, including higher-risk media transformations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The template_to_video category includes ports that actually return static images via image_edit_gen and related image-edit endpoints, which diverges from the declared capability and can bypass feature-specific safeguards. Mislabeling output types undermines review assumptions and may cause callers to apply the wrong moderation, consent, or content-handling controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This manifest file specifies asynchronous API endpoints for submitting image-to-video generation requests, which implies user-provided image data will be transmitted to a remote service. The only existing warning discusses generation time, not that user content leaves the local system or is processed by an external provider.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes text-to-image, image-to-image, image-to-video, and keyframe-to-video generation, while this video-template configuration also includes direct image editing/image generation endpoints such as /v2/image/image_easy_edit/async. That is broader than a pure template-to-video capability and mixes image-only operations into a video template registry.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file is for the "template_to_video" category, but several entries are explicitly documented and configured to return images via image endpoints rather than videos. That diverges from both the category name and the skill manifest's framing around video generation modes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This manifest contains user-facing name and description fields in Chinese (e.g. "文生图" and "从文本描述生成图像") while providing no indication that the skill is region-specific or that users can choose their preferred language. That creates a natural-language locale policy concern because the skill appears to impose a specific language by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This Python file contains user/developer-facing natural-language text in Chinese in the module docstring and class docstrings. The policy requires avoiding forced language or locale constraints unless the skill offers opt-in or clearly documents a justified regional limitation, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstrings and all user-facing console messages are written only in Chinese, indicating a fixed language choice for the skill's interaction surface. The file provides no opt-in, fallback, or documented reason for restricting the locale, which matches the policy category for forced language without user choice.

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 natural-language strings and documentation in Chinese, beginning with the module docstring and continuing in user-facing output. Under the policy rule, forcing a specific language without user opt-in is a locale/language policy concern unless the tool is clearly documented as region-specific, which is not evident here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script's runtime status, success, and error messages are emitted only in Chinese, which constrains user interaction to one language. The file does not offer opt-in language selection or explain that the skill is intended only for a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends the user-supplied prompt to Vivago's external video-generation service via client.text_to_video(...) without any explicit notice or consent mechanism at the point of transmission. Prompts can contain sensitive business, personal, or confidential information, so silent forwarding to a third party creates a real privacy and data-sharing risk in this skill context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This JSON manifest contains a template whose identifying text is just "Shake It Down" in both the main prompt and custom prompt. As a manifest file, it falls under vague-trigger review, and this phrase is broad, colloquial, and lacks any constraint or negative examples to distinguish when this template should be selected versus ordinary user speech.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest identifies a template only as "Kiss Kiss" with no additional context about intended use, subject type, or exclusion conditions. In a manifest file, such a short everyday phrase is overly broad and can overlap with common language, increasing the risk of unintended invocation or mismatched template selection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user- and developer-facing natural language exclusively in Chinese in the module docstring and class docstring. Under the language/locale policy, forcing a specific language without opt-in or justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.