Back to skill

Security audit

avatar-outfit-motion-video

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI media workflow, but it needs review because it handles portraits and voices with weak consent/privacy boundaries and includes unsafe model-loading scripts.

Review this skill before installing. Only use model weights from a trusted, verified source, avoid arbitrary .pth files, and treat uploaded face, voice, product, and background assets as sensitive. Before any lip-sync, digital-human, product-placement, or cloud-connector workflow, require clear permission to use the likeness, voice, copyrighted material, and brand assets, and confirm where data will be processed.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/infer_depth.py:31
Finding
Unsafe Deserialization of User-Supplied PyTorch Model in Image Depth Inference## Vulnerability Details **File Location**: `scripts/infer_depth.py:31` **Vulnerability Type**: Unsafe PyTorch model deserialization **Risk Level**: High **Complete Code Snippet**: ```python model = DepthAnythingV2(**MODEL_CONFIGS[encoder]) model.load_state_dict(torch.load(model_path, map_location='cpu')) model = model.to(DEVICE).eval() ``` ### Technical Analysis The script accepts `model_path` from a command-line argument and passes it directly to `torch.load`: ```python model_path = sys.argv[1] if len(sys.argv) > 1 else 'depth_anything_v2_vitb.pth' ``` PyTorch model files can use Python pickle-based serialization. On PyTorch versions or configurations where unrestricted deserialization is used, loading an untrusted `.pth` file may invoke attacker-controlled pickle reduction functions and execute arbitrary Python code. This occurs during `torch.load`, before `load_state_dict` can validate whether the result is a legitimate state dictionary. The risk is increased by documentation instructing users to download model weights from an unspecified `hf-mirror` source without an exact immutable URL, revision, checksum, signature, or provenance-verification procedure. The model loading itself is necessary for depth inference, but unrestricted deserialization is not the minimum privilege or safest mechanism required for that functionality. ### Attack Path 1. An attacker creates a malicious `.pth` file containing a pickle payload that invokes an operating-system command during deserialization. 2. The attacker supplies the file directly, replaces a downloaded model, or compromises the unspecified mirror or distribution channel. 3. A user or Agent invokes: ```bash python scripts/infer_depth.py malicious.pth input.png depth.png vitb ``` 4. The script passes `malicious.pth` to `torch.load`. 5. The pickle payload executes before `model.load_state_dict` validates the loaded object. 6. The payload runs with ...[truncated 725 chars]
Remediation
## Remediation Suggestions 1. Use a supported PyTorch release and explicitly enable restricted weight-only loading: ```python state_dict = torch.load( model_path, map_location="cpu", weights_only=True, ) model.load_state_dict(state_dict) ``` 2. Prefer a non-executable tensor serialization format such as `safetensors`. 3. Distribute an exact official model URL pinned to an immutable revision rather than referring generically to a mirror. 4. Publish an expected SHA-256 digest and verify it before loading: ```python import hashlib def sha256_file(path): digest = hashlib.sha256() with open(path, "rb") as source: for chunk in iter(lambda: source.read(1024 * 1024), b""): digest.update(chunk) return digest.hexdigest() ``` 5. Reject the model unless its checksum matches an allowlisted value. 6. Validate that the loaded value is a dictionary containing only expected parameter keys and tensor values. 7. Treat all caller-supplied model files as untrusted. If legacy pickle-based checkpoints must be supported, load them only in an isolated, unprivileged environment with minimal filesystem and network access.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/video_to_depth.py:41
Finding
Unsafe Deserialization of User-Supplied PyTorch Model in Video Depth Inference## Vulnerability Details **File Location**: `scripts/video_to_depth.py:41` **Vulnerability Type**: Unsafe PyTorch model deserialization **Risk Level**: High **Complete Code Snippet**: ```python model = DepthAnythingV2(**MODEL_CONFIGS[encoder]) model.load_state_dict(torch.load(model_path, map_location='cpu')) model = model.to(DEVICE).eval() ``` ### Technical Analysis The video-processing entry point obtains `model_path` from its first command-line argument: ```python model_path = sys.argv[1] if len(sys.argv) > 1 else 'depth_anything_v2_vitb.pth' ``` It then deserializes the selected file through `torch.load` without explicitly requesting restricted weight-only behavior. PyTorch checkpoint files may contain Python pickle data. Under an unrestricted loading configuration, pickle reconstruction can execute attacker-defined code before the result reaches `load_state_dict`. Loading model parameters is required for the declared depth-video functionality, but permitting general pickle reconstruction is unnecessary. The absence of a pinned model source and integrity verification also leaves the model supply chain open to substitution. ### Attack Path 1. An attacker prepares a malicious PyTorch checkpoint containing a code-execution payload. 2. The malicious checkpoint is supplied as an action model or substituted for the documented Depth Anything V2 weights. 3. A user or Agent executes: ```bash python scripts/video_to_depth.py malicious.pth input.mp4 depth_video.mp4 vitb ``` 4. The script invokes `torch.load` on the attacker-controlled path. 5. Payload execution occurs as part of deserialization, before video processing begins. 6. The payload inherits the Python process's filesystem, environment, and network permissions. ### Impact Assessment Exploitation can result in arbitrary local code execution with the invoking account's privileges. This may expose readable project data, media assets, API ...[truncated 391 chars]
Remediation
## Remediation Suggestions 1. Replace unrestricted loading with explicit weight-only loading on a supported PyTorch version: ```python state_dict = torch.load( model_path, map_location="cpu", weights_only=True, ) model.load_state_dict(state_dict) ``` 2. Migrate distributed weights to `safetensors` where possible. 3. Pin the official model artifact to an immutable release or commit. 4. Document and enforce a cryptographic checksum for the approved model file. 5. Validate the loaded state dictionary's type, keys, tensor values, and compatibility before applying it. 6. Fail closed if restricted loading is unavailable rather than silently falling back to unrestricted pickle loading. 7. If legacy checkpoints are unavoidable, deserialize them in a sandboxed process with no secrets, no unnecessary network access, a read-only project mount, and a dedicated output directory.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This code chunk is a generic computer vision model implementation: a DINOv2 transformer backbone used for extracting image representations. It processes tensors, builds transformer layers, returns class/patch token features, and exposes model variants. There is nothing here for avatar generation, outfit swapping, motion transfer, audio processing, lip-sync, scene replacement, product insertion, or final video/static asset composition as claimed in the description. While such a backbone could be a supporting component inside a larger media pipeline, this snippet by itself materially differs from the declared end-user functionality and instead implements low-level vision feature extraction.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description presents a high-level end-user skill for generating and composing avatar, clothing, action, audio, background, and prop assets into videos or images. The supplied code chunk does not implement that behavior. It only exposes low-level deep learning layer classes from a depth/DINOv2-related library via imports in an __init__.py file. This is an internal support module and, by itself, does not perform the described media-generation workflow or any of the listed triggerable capabilities. Therefore the description does not accurately represent what this code chunk actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description describes a high-level AI media generation system for outfit changes, motion transfer, digital humans, lip-sync, background replacement, and compositional video/static asset production. In contrast, the supplied code is a generic attention layer used inside transformer architectures. It only defines tensor projections, attention score computation, softmax, dropout, output projection, and an optional xFormers memory-efficient implementation. This is merely a supporting ML component and, by itself, does not implement any of the user-facing capabilities in the description. Because the actual code chunk’s primary purpose is materially different from the declared skill purpose, this is a clear mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The description claims an end-user skill for generating and combining multiple visual/video elements into fashion, motion-transfer, digital human, and product-placement outputs. However, the code chunk only defines a transformer model block and helper functions for stochastic depth, residual addition, attention bias caching, and nested tensor batching. This is infrastructure for deep learning models, not application logic for avatar/garment/action composition or media generation workflows. While such a block could be part of a larger vision model used somewhere in that system, this chunk by itself does not implement the declared functionality and has a materially different primary purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description presents a high-level AI media generation/compositing skill focused on avatar, clothing, motion, audio lip-sync, backgrounds, and product props. The supplied code chunk does none of that directly: it only provides a generic deep-learning layer helper that randomly drops residual paths during training (stochastic depth). This is a low-level model component and not an implementation of the described generation/composition features. While such code could exist inside a larger ML project, this specific chunk's actual purpose is materially different from the declared skill behavior, so it should be flagged as a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description describes a broad multimedia generation and composition system for avatar/clothing/action video workflows. The supplied code chunk is only a low-level neural network utility layer used in model architectures: it initializes a learnable scaling vector and applies it to tensors in `forward`. This is an internal mathematical component, not an implementation of the described skill behavior. While such a layer could be part of a larger vision model, this chunk by itself does not implement the declared media-generation pipeline or any of its stated end-user capabilities, so the description does not accurately represent the code shown.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description is for a full multimedia generation and composition system focused on avatar/clothing/action/video workflows. The actual code chunk is only a generic neural-network building block (an MLP layer) used as supporting model infrastructure. By itself, it does not implement the described end-user capabilities, triggers, or pipeline behavior. This is a material description-behavior mismatch because the supplied code's primary purpose is unrelated low-level model computation rather than the claimed media-generation skill functionality.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The supplied code is a narrow, low-level neural network component for patchifying images into embeddings, likely as part of a vision backbone. It does not implement the declared end-user functionality of a six-element avatar/clothing/action media-generation pipeline, nor does it process audio, video composition, scene replacement, product insertion, or asset combination logic. This is not merely a supporting detail clearly tied to the declared behavior in isolation; the code’s primary purpose is materially different from the declared skill description.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This code is a low-level neural network component used inside machine learning models: two linear layers with SwiGLU activation, plus a fused implementation fallback. It is not an implementation of the declared end-user skill behavior. There are no triggers, I/O handlers, media-processing routines, prompt handling, or orchestration steps corresponding to the described avatar/clothing/action composition system. While such a layer could theoretically be used as a building block inside a larger vision model, this specific chunk by itself does not substantiate the declared functionality, so the description materially overstates and misrepresents the code’s actual purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The supplied code does not implement avatar generation, clothing synthesis, action composition, lip-sync, background replacement, product insertion, or video assembly. Instead, it builds and runs a neural network for estimating scene depth from a single image. This is a materially different primary purpose from the declared description. While depth estimation could theoretically support some visual generation workflows, this chunk itself is focused on depth inference and is not accurately represented by the declared skill description.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The supplied code is a small internal model utility module using torch.nn to construct convolutional layers, residual blocks, and feature fusion/upsampling blocks. This is consistent with a computer vision model backbone/decoder component, likely for depth or feature refinement, not with the declared purpose of a complete six-element avatar/clothing/action video generation and composition system. While such blocks could theoretically be a supporting subcomponent inside a larger vision system, this chunk by itself does not implement or clearly support the specific declared behaviors such as outfit swapping, action transfer, lip-sync, digital human narration, background replacement, product placement, or prompt/asset-based composition. The primary purpose of the code is materially different from the declared skill description, so this is a mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description presents a high-level multimodal content generation and composition system for AI outfit videos, motion transfer, digital humans, lip-sync, background replacement, and product placement. In contrast, the actual code chunk only defines three preprocessing transforms: Resize, NormalizeImage, and PrepareForNet. These functions manipulate NumPy/OpenCV image, depth, and mask arrays for model input preparation. There is no code for generating avatars, clothing, actions, videos, audio processing, lip synchronization, scene replacement, product insertion, or content orchestration. While such preprocessing could support a vision model internally, this chunk's actual behavior is materially narrower and does not substantiate the declared end-user functionality. Therefore, the description does not accurately represent what this code chunk actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description describes a broad media-generation/compositing system focused on avatars, clothing changes, action transfer, lip-sync, background replacement, product placement, and short-video/static-asset creation. In contrast, the supplied code only performs monocular depth inference on one image and outputs depth maps. There is no evidence in this code chunk of avatar generation, clothing synthesis, action transfer, lip-sync/audio processing, background replacement, prop insertion, composition logic, or safety/guard pipeline. While the declared triggers mention “深度视频提取,” this code is still materially narrower and different in primary purpose: it is an image depth utility, not the described six-element avatar-video composition skill.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description presents a broad generative media pipeline for avatar/clothing/action assembly, lip-sync, background replacement, prop insertion, and outputting stylized short videos or static assets. The actual code does none of those things. It does not generate avatars, clothing, actions, speech, backgrounds, props, or composition outputs. Instead, it performs a specific preprocessing/analysis task: estimating depth for each video frame and exporting the result as a depth video. While the description briefly mentions a trigger related to '深度视频提取' (depth video extraction), the code's actual primary purpose is much narrower and materially different from the declared overall skill behavior. Therefore this is a clear description-behavior mismatch.

Vague Triggers

Medium
Confidence
87% confidence
Finding
The skill defines positive trigger phrases but no negative boundaries, making routing ambiguous. In a media-manipulation skill that may process portraits, audio, backgrounds, and product imagery, ambiguous activation raises the risk of accidental invocation on requests that should instead receive clarification or stricter consent/compliance screening.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The workflow explicitly allows '自由组合静态产物直接交付(无需 AOM5 成片质检)', which creates a documented bypass of the only described review/guardrail stage. In this skill context, static outputs can still contain unsafe or policy-violating identity, product-placement, deceptive advertising, or manipulated-person imagery, so excluding them from any equivalent compliance check increases abuse risk.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill explicitly instructs the agent to collect user-provided avatar images, voice audio or scripts, background images, and product materials, but it does not require any privacy, consent, copyright, or publicity-rights warning before intake. In this context, the materials are highly likely to contain biometric, identity, commercial, or third-party copyrighted content, so omission of consent and rights checks creates a realistic risk of unauthorized cloning, impersonation, or misuse of protected assets.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The audio preparation flow allows user-provided, TTS-generated, or random voice output without any warning that voice data and synthesized speech may implicate privacy, consent, impersonation, and likeness rights. Because the skill is specifically designed for lip-synced digital-human videos, the missing warning is more dangerous than in a generic audio tool: it can directly facilitate convincing voice-based impersonation or unauthorized use of someone's vocal identity.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The document explicitly requires the output format for prompts to be in English, which imposes a specific language choice as part of the skill behavior. Under the policy, forcing a language without user opt-in is a natural-language policy violation unless the constraint is justified or optional.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill describes TTS-based audio generation using user-provided text or audio sources but does not warn that script content, voice samples, or related metadata may be transmitted to an external model or service. In a workflow that creates digital-human narration and lip-sync media, this omission can lead users to submit sensitive personal, commercial, or biometric content without informed consent or appropriate handling expectations.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill explicitly instructs users to feed audio files and character images into lip-sync models and potentially cloud connectors, but it provides no warning about privacy, consent, retention, or third-party processing. Because voice data and portrait images are biometric or highly identifying data, sending them to local or remote models without clear disclosure can expose sensitive personal information and create compliance, consent, and misuse risks.

Insecure deserialization: torch.load() without weights_only=True

Medium
Category
Dangerous Code Execution
Content
print('[info] device =', DEVICE)
    print('[info] loading model ...')
    model = DepthAnythingV2(**MODEL_CONFIGS[encoder])
    model.load_state_dict(torch.load(model_path, map_location='cpu'))
    model = model.to(DEVICE).eval()
    print('[info] model loaded')
Confidence
98% confidence
Finding
The code deserializes a PyTorch checkpoint using torch.load() without restricting loading to tensor weights. PyTorch checkpoints are pickle-based, so if an attacker can supply or replace the model file, arbitrary Python code may execute during loading, making this a genuine code-execution risk rather than a mere robustness issue.

Insecure deserialization: torch.load() without weights_only=True

Medium
Category
Dangerous Code Execution
Content
print('[info] device =', DEVICE)
    print('[info] loading model ...')
    model = DepthAnythingV2(**MODEL_CONFIGS[encoder])
    model.load_state_dict(torch.load(model_path, map_location='cpu'))
    model = model.to(DEVICE).eval()
    print('[info] model loaded')
Confidence
97% confidence
Finding
This uses torch.load() on a path influenced by command-line input without restricting deserialization behavior. PyTorch pickle-based loading can execute attacker-controlled code during model loading, so a malicious .pth file could achieve arbitrary code execution on the host before inference even begins.

Vague Triggers

Low
Confidence
84% confidence
Finding
The skill defines positive trigger phrases but no negative boundaries, making routing ambiguous. In a media-manipulation skill that may process portraits, audio, backgrounds, and product imagery, ambiguous activation raises the risk of accidental invocation on requests that should instead receive clarification or stricter consent/compliance screening.

Natural-Language Policy Violations

Low
Confidence
97% confidence
Finding
The error message includes Chinese text ('可选') alongside English, which imposes a locale-specific element in user-facing output without any opt-in or documented language choice. This can violate language/locale policy expectations for neutral or user-selected language behavior.

Static analysis

No suspicious patterns detected.