Back to skill

Security audit

Wildberries 商品图、主图套图、详情图、活动图生成 | LinkPix

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with Wildberries image generation, but it includes automatic mutable package installs and unsafe image-compression command examples that should be reviewed before use.

Install only if you are comfortable with qhkit handling product images and with configuring a qhkit API token. Prefer an isolated project or container, review package versions before installing, avoid automatic @latest upgrades, and use safely quoted file paths or a fixed script for image compression.

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)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:93
Finding
Command and Python Code Injection Through Unsafe File-Path Interpolation## Vulnerability Details **File Location**: `SKILL.md`, line 93 **Vulnerability Type**: Command injection caused by unsafe interpolation of user-controlled file paths **Risk Level**: High **Vulnerable code snippet**: ```bash python -c "from PIL import Image, ImageOps; im=ImageOps.exif_transpose(Image.open('原图')); im.thumbnail((2048,2048)); im.convert('RGB').save('压缩后.jpg', quality=85)" npx --yes sharp-cli -i 原图 -o 压缩后.jpg resize 2048 ``` ### Technical Analysis The Skill instructs the Agent to replace the placeholder input and output paths directly inside shell commands. In the Python variant, the input path is interpolated into a Python string literal embedded within the `python -c` argument. A path containing a single quote or other Python syntax can terminate the string and inject additional Python statements. The `sharp-cli` fallback passes paths as unquoted shell arguments. Filenames containing shell metacharacters, command substitutions, whitespace, or redirection operators can modify the command when interpreted by a shell. A filename beginning with a hyphen may also be interpreted as a command-line option. The vulnerable compression workflow is triggered when an input image exceeds 10 MB. Product images are user-supplied inputs, so their local filenames cannot safely be assumed to contain only trusted characters. ### Attack Path 1. An attacker supplies an image larger than 10 MB so that the documented compression workflow is activated. 2. The image is stored under a crafted filename containing Python syntax or shell metacharacters. 3. The Agent substitutes that path into the documented `python -c` or `npx` command. 4. The shell parses the resulting command, or Python parses the modified inline program. 5. Attacker-controlled code executes under the operating-system account running the Agent. ### Impact Assessment Successful exploitation can execute arbitrary commands with the Agent process's user privil ...[truncated 486 chars]
Remediation
## Remediation Suggestions - Never interpolate file paths into an inline Python program. - Use a fixed Python script and pass input and output paths through `sys.argv`. - Invoke subprocesses through an argument array without a shell, such as Python's `subprocess.run([...], shell=False, check=True)`. - If shell execution is unavoidable, apply robust shell quoting to every path and place `--` before positional filenames where the target utility supports it. - Generate the output path internally in a controlled temporary directory rather than deriving executable command text from user input. - Validate that the input is a regular image file and reject paths containing null bytes or paths outside approved working directories. - Avoid relying on filename extensions alone; decode and validate the image before processing it. - Add tests using filenames containing quotes, spaces, semicolons, command substitutions, leading hyphens, and newline characters.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:54
Finding
Execution of Mutable and Unpinned Third-Party Dependencies## Vulnerability Details **File Location**: `SKILL.md`, lines 54-57, 80, and 93 **Vulnerability Type**: Unpinned dependency installation and automatic execution from external package registries **Risk Level**: Medium **Vulnerable code snippets**: ```bash npm i -g @iqinghu/qhkit npx @iqinghu/qhkit <command> ... npm i -g @iqinghu/qhkit@latest pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i 原图 -o 压缩后.jpg resize 2048 ``` The instructions also permit npm registry fallback through: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill installs and executes packages without pinning reviewed versions or validating package integrity. The `@latest` upgrade explicitly selects a mutable release, while `npx --yes` can download and immediately execute package code without interactive review. npm packages may execute lifecycle scripts during installation, and package executables invoked through `npx` run with the Agent's user privileges. The alternative npm and Python mirrors expand the supply-chain trust boundary beyond the official package registries. The Node.js archive installation at lines 62-64 is not a `curl | bash` operation. It downloads an archive and separately verifies it against the official checksum manifest before extraction. That sequence is not itself a confirmed remote-script execution vulnerability. The dependency concern instead arises from the unpinned npm and Python package installations performed afterward. ### Attack Path 1. A legitimate package account, registry, mirror, package release, or transitive dependency is compromised. 2. The attacker publishes malicious code under the package version selected by the unpinned install or `@latest`. 3. The Agent follows the bootstrap, upgrade, or image-compression instructions. 4. npm, pip, or `npx --yes` retrieves the mutable package from an external registry or mirror. 5. Mal ...[truncated 649 chars]
Remediation
## Remediation Suggestions - Pin every npm and Python dependency to a reviewed exact version. - Remove `@latest` upgrades and avoid automatic `npx --yes` execution. - Use lockfiles and verified integrity hashes for all package artifacts and transitive dependencies. - Prefer project-local or isolated installations over global npm installation. - Require explicit user approval before installing or upgrading executable dependencies. - Prefer official registries; if a mirror is necessary, document its additional trust implications and independently verify downloaded artifacts. - Disable package lifecycle scripts where feasible, then explicitly run only reviewed setup operations. - Install Python dependencies in a dedicated virtual environment rather than the Agent's shared environment. - Periodically audit pinned dependencies and update them through a controlled review process.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (1)

Natural-Language Policy Violations

Medium
Confidence
81% confidence
Finding
The skill instructs that copy for the Wildberries/Russian-market output should be in Russian, which can override user preference if not explicitly confirmed. This is not a classic security exploit, but it is a real policy/consent issue because the agent may generate unintended foreign-language content or platform-specific messaging without opt-in.

Static analysis

No suspicious patterns detected.