Back to skill

Security audit

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

Security checks for vulnerabilities and agentic risk

Overview

The skill is for a real image-generation workflow, but it tells the agent to collect an API key in chat and install mutable third-party tooling on the user's machine.

Review this skill before installing. Use it only if you trust the qhkit provider and are comfortable with local package installation and external image uploads. Do not paste API keys into chat; configure credentials through a protected local or platform secret mechanism instead, and prefer pinned or preinstalled dependencies.

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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:54
Finding
Unpinned Third-Party Packages Are Installed and Executed Automatically## Vulnerability Details **File Location**: `SKILL.md`, lines 54–57, 76–82, and 93 **Vulnerability Type**: Supply-chain exposure through unpinned package installation **Risk Level**: Medium ### Vulnerable Code Snippet ```bash npm i -g @iqinghu/qhkit ``` ```bash npx @iqinghu/qhkit <command> ... ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i input-image -o compressed-image.jpg resize 2048 ``` ### Technical Analysis The Skill directs the Agent to install and execute third-party npm and Python packages without pinning reviewed versions or package integrity hashes. In particular: - A bare `npm i -g @iqinghu/qhkit` resolves whatever version is current at execution time. - `@latest` explicitly retrieves a mutable release rather than a reviewed version. - `npx` can download and immediately execute a package that is not already installed. - `npx --yes` suppresses the interactive installation prompt. - Pillow and `sharp-cli` are installed without fixed versions. - Alternate npm and Python registries introduce additional supply-chain trust. - Global npm installation broadens the package's reach and can execute npm lifecycle scripts during installation. This means the effective code executed by the Skill can change after the Skill itself has been audited. The installation instructions are related to the declared functionality, but automatic unpinned installation exceeds the minimum-risk approach because dependencies could instead be version-locked and installed in an isolated environment. The flagged checksum command at line 63 is not a `curl | bash` execution chain. It downloads a checksum manifest and passes it through `grep` to `sha256sum -c`. That specific command therefore is not the vulnerability described here. ### Attack Path 1. An attacker compromises a referenced package publisher account, upstream package, or configured package registry. 2. The attacke ...[truncated 1443 chars]
Remediation
## Remediation Suggestions 1. Pin every dependency to a specifically reviewed version, including `@iqinghu/qhkit`, Pillow, and `sharp-cli`. 2. Remove `@latest` from automated upgrade instructions. Require a separate review before changing the pinned version. 3. Use npm lockfiles and integrity metadata where possible. Verify downloaded package artifacts against trusted hashes or signatures. 4. Avoid `npx --yes` for packages that have not already been installed and verified. Invoke a locally pinned binary instead. 5. Install dependencies in a dedicated project directory, virtual environment, or restricted container rather than globally. 6. Disable npm lifecycle scripts during installation when they are unnecessary, then explicitly run only reviewed setup steps. 7. Use the official package registry by default. If a mirror is necessary, document its trust boundary and verify that package integrity matches the official source. 8. Run image-processing tools with only the filesystem and network permissions required for the specific input and output files. 9. Maintain an allowlist of reviewed dependency names, versions, hashes, and expected publishers.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:69
Finding
API Token Is Requested Through Chat and Passed as a Command-Line Argument## Vulnerability Details **File Location**: `SKILL.md`, lines 69–72 **Vulnerability Type**: Insecure secret collection and command-line exposure **Risk Level**: Medium ### Vulnerable Code Snippet ```bash qhkit config set --token <API_KEY> --env prod ``` The accompanying instructions tell the Agent to ask the user to send the generated API key through the conversation before executing this command. ### Technical Analysis The API token is legitimately required to use the declared image-generation service, but the prescribed acquisition and transport method unnecessarily exposes the credential. Requesting the token in chat can place it in conversation history, Agent traces, support exports, telemetry, and other retained records. Supplying it through the `--token` command-line option can additionally expose it through: - Shell history. - Process listings and process-monitoring utilities. - Command audit logs. - Tool invocation records. - Debugging or error telemetry. This violates least exposure for secrets. A protected secret entry mechanism, masked prompt, or secret manager would meet the functional requirement without disclosing the credential to the conversation or command line. ### Attack Path 1. The user creates an API token for the external service. 2. Following the Skill's instructions, the user sends the plaintext token in the conversation. 3. The Agent places the token into the `qhkit config set --token ...` command. 4. The plaintext token is retained in one or more locations, such as conversation logs, tool-call logs, shell history, process metadata, or telemetry. 5. A party with access to one of those records retrieves the token. 6. The party authenticates to the external service as the user and performs operations permitted by that token. No direct token exfiltration code was found in the Skill. Exploitation requires access to a location in which the exposed token was retained. ### Impact Assessment The expected impact is limited to ...[truncated 540 chars]
Remediation
## Remediation Suggestions 1. Do not ask users to send API keys through the conversation. 2. Instruct users to configure the token themselves through a masked terminal prompt, platform secret store, or approved secrets manager. 3. Add a CLI option that reads the token from standard input without echoing it, rather than accepting it as a command-line argument. 4. If an environment variable is supported, populate it through the hosting platform's protected secret-injection facility rather than through chat or a recorded shell command. 5. Ensure persisted credential files have restrictive permissions and are excluded from backups, logs, and project artifacts where appropriate. 6. Redact tokens from command traces, stdout, stderr, telemetry, and error messages. 7. Avoid storing secret-bearing commands in shell history. 8. Use narrowly scoped, short-lived tokens where supported. 9. Provide explicit token rotation and revocation instructions in case a token has already been disclosed through chat or logs.
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The skill directs the agent to install Node.js, globally install a CLI, and perform upgrades as part of normal execution. That grants the skill broader host-management and software-modification capability than is necessary for describing or orchestrating image generation, increasing supply-chain and environment-tampering risk if the package, registry, or instructions are abused.

Context-Inappropriate Capability

Medium
Confidence
97% confidence
Finding
The skill explicitly tells the agent to solicit the user's API key in chat and then configure it locally. Asking users to paste secrets into the conversation creates a credential-exposure path to the model, logs, and any downstream tooling, which is unnecessary and unsafe for a media-generation skill.

Vague Triggers

Medium
Confidence
77% confidence
Finding
The metadata states the skill 'must trigger' for a broad class of Pinduoduo image requests without clear exclusions or tighter matching boundaries. Over-broad mandatory activation can cause the agent to invoke this skill in inappropriate contexts, unnecessarily exposing users to its installation, external-service, and credential-handling behaviors.

Vague Triggers

Medium
Confidence
74% confidence
Finding
The trigger guidance in the markdown is broad and ambiguous, covering generic requests for product, detail, and activity images with limited scope constraints. In this skill's context, ambiguous activation is more dangerous because invocation may cascade into package installation, network access, and secret-handling steps that are not always necessary.

Ssd 3

High
Confidence
99% confidence
Finding
The skill instructs the agent to have the user send an API key back in chat, then use it with a command-line configuration step. This is a direct secret-collection anti-pattern: chat channels and model context are not appropriate secret-ingress mechanisms, and compromise of logs or transcripts could expose the credential.

Static analysis

No suspicious patterns detected.