Back to skill

Security audit

电商印花提取 | 图案提取 | POD印花 | 高清印花 | 青虎AI

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its image-pattern extraction purpose, but it gives agents broad software installation and upgrade authority that should be reviewed before use.

Review before installing. Only run this skill in an environment where you are comfortable uploading selected images to Qinghu/qhkit and using a qhkit API token. Manually approve and pin any qhkit or Node installation or upgrade, and do not execute upgrade commands copied from CLI output without verifying the exact command and source.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:57
Finding
Execution of Untrusted Upgrade Commands Returned by a Remote Service<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 57 **Vulnerability Type**: Remote command retrieval and execution **Risk Level**: High ### Vulnerable Code ```text **升级**:出现以下任一信号,先升级再重试原命令——命令返回 `{"ok":false,"stage":"version",...}`(版本门禁,message 里就是升级命令,照做即可);stderr 提示有新版本;`options` 返回 `catalogNotice` 且用户恰好要用那个新模型;报「模式在线上已下架或配置变更,请升级 qhkit」。 ``` The relevant instruction translates to: “The message contains the upgrade command; execute it exactly as instructed.” ### Technical Analysis The Skill instructs the agent to treat the `message` field returned by `qhkit` as an executable upgrade command. Because `qhkit` communicates with an external service, the effective command can be influenced by systems outside the reviewed Skill package. There is no command allowlist, package-name validation, argument validation, version validation, shell metacharacter rejection, or user confirmation before execution. This creates a remote payload execution channel: the static Skill contains only the instruction to execute a command, while the command itself can change after the Skill has been reviewed. This behavior is not required for the declared image-pattern extraction functionality. A fixed, locally defined update operation would satisfy the legitimate update requirement without executing server-provided command text. ### Attack Path 1. The agent invokes `qhkit` while processing an image-generation request. 2. A compromised CLI dependency, service endpoint, service account, or upstream response returns a result with `stage:"version"`. 3. The attacker places an arbitrary shell command in the response's `message` field and presents it as an upgrade instruction. 4. The Skill directs the agent to execute that command verbatim. 5. The command runs with the privileges and filesystem/network access of the agent process. 6. The attacker can subsequently read or alter data accessible to that account, retrieve additional payloads, or establish persistence ...[truncated 766 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the instruction to execute the contents of the remote `message` field. 2. Treat all CLI output, including error and upgrade messages, as untrusted data intended only for display or structured parsing. 3. Define the permitted update command locally. Do not derive executable text from a remote response. 4. Pin the update to a reviewed version instead of using a server-selected command or the `latest` tag, for example: ```bash npm install --global @iqinghu/qhkit@<reviewed-version> ``` 5. Validate the selected version against a strict semantic-version pattern and a local allowlist. 6. Require explicit user approval before installing or updating software. 7. Prefer a user-scoped or isolated installation rather than a global installation. 8. If automated updating is essential, invoke the package manager directly with separately validated arguments and without passing data through a shell. 9. Log the requested version and verified package integrity, but never log API tokens or other secrets. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:39
Finding
Unpinned Global Installation and Execution of a Third-Party npm Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 39–42 and 57–63 **Vulnerability Type**: Unsafe third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```text 默认走 npm 官方源;官方源访问慢或超时(国内网络常见)时,再加镜像参数 `--registry=https://registry.npmmirror.com`(阿里维护的 npm 官方镜像,仅作网络兜底)。仅当全局安装因权限失败且无法提权时,才退而用 `npx @iqinghu/qhkit <命令> ...`(npx 必须写包全名)。 ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ```text 官方源慢或超时时同样加 `--registry=https://registry.npmmirror.com`。 ``` ### Technical Analysis The Skill installs and executes `@iqinghu/qhkit` without pinning a reviewed version. It also explicitly recommends the mutable `latest` tag during upgrades. Consequently, the code executed by the Skill can change independently of the audited repository. npm packages can execute lifecycle scripts during installation. A compromised publisher account, malicious package release, registry compromise, or unsafe transitive dependency could therefore execute code as part of installation. Global installation also expands the modification scope by writing package files and command shims into a shared executable location. The fallback to a third-party registry mirror increases the number of supply-chain systems that must be trusted. The use of `npx` as a fallback can similarly download and execute a package at invocation time when it is not already cached locally. The dependency is relevant to the declared functionality, but mutable, global installation is broader than the minimum privilege necessary. A pinned, integrity-verified, user-scoped or isolated installation would provide the required CLI with less exposure. ### Attack Path 1. An attacker compromises the npm publisher, a registry or mirror, a package release, or a transitive dependency. 2. A malicious release becomes the version resolved by the unpinned package name or `@latest`. 3. The agent follows the Skill and runs `npm i -g`, or uses `npx` to download and ...[truncated 1083 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specific reviewed version. Do not use an unversioned package reference or the `latest` tag. 2. Record and verify package integrity using a lockfile, npm integrity metadata, or a separately trusted digest. 3. Review the package and its transitive dependencies before approving a new version. 4. Prefer an isolated, project-local installation over `npm install --global`. 5. Run the CLI under a dedicated, unprivileged account or sandbox with access only to the images explicitly selected for upload. 6. Do not automatically fall back to `npx`, because it may retrieve and immediately execute an unreviewed package. 7. Require explicit user approval before package installation, upgrades, or registry changes. 8. Use the official npm registry unless an alternative registry has been independently approved and its trust implications are clearly disclosed. 9. Consider disabling npm lifecycle scripts during installation where compatible: ```bash npm install --ignore-scripts --save-exact @iqinghu/qhkit@<reviewed-version> ``` 10. If lifecycle scripts are required, inspect them before installation and perform the installation in a restricted environment. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The metadata description says requests to extract patterns from clothing images 'must trigger', and also includes a broad keyword list. This can cause the skill to activate in cases where the user did not explicitly ask to use this tool, leading to unintended tool invocation and possible processing of user images or workflow changes without clear consent.

Vague Triggers

Low
Confidence
88% confidence
Finding
The '何时触发' section gives positive examples but lacks explicit non-trigger cases and boundary conditions. That ambiguity increases the chance of accidental activation when the user is only discussing POD workflows or asking conceptual questions, which can result in unnecessary tool use and confusion.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill instructs the agent to install software globally, download Node binaries, modify PATH, and configure API credentials, all framed as environment bootstrapping '不要因环境缺失放弃任务'. These are significant local system changes and secret-handling steps, but the skill does not require explicit user approval before performing them, creating risk of unauthorized environment modification, supply-chain exposure, and credential misuse.

Static analysis

No suspicious patterns detected.