Back to skill

Security audit

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

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill is mostly coherent, but it asks for an API key in chat and directs the agent to install or execute unpinned third-party tools on the user's machine.

Review before installing. Use this only if you trust the Qinghu/qhkit supply chain and are comfortable with product images being uploaded to that service. Do not paste API keys into chat; configure credentials yourself through a private secret store or local terminal flow, and prefer a preinstalled, pinned qhkit instead of letting the agent install or upgrade packages automatically.

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

Error
Location
SKILL.md:53
Finding
Unpinned Third-Party Packages Are Installed and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 53–91 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: High ### Vulnerable Code ```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 ``` ```bash npx --yes sharp-cli -i source-image -o compressed-image.jpg resize 2048 ``` The instructions also permit alternate registries: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill directs the agent to install or immediately execute mutable third-party packages without pinning exact versions or verifying package integrity. The global installation of `@iqinghu/qhkit`, the explicit use of the mutable `latest` tag, and `npx --yes` execution all allow package code to change after the Skill has been audited. NPM packages can run lifecycle scripts during installation, while packages invoked through `npx` execute code under the current agent user's account. The alternate NPM and Python registries expand the number of infrastructure components that must be trusted. No lockfile, package integrity value, package signature, or independently pinned digest is specified. These package installations are not inherently malicious, but they create a supply-chain execution channel that exceeds the minimum privilege necessary. A safer design would require a preinstalled, vetted CLI or a package pinned to a reviewed version and integrity digest rather than automatically installing arbitrary future releases. The nearby Node.js download pipeline is not a `curl | bash` operation. It downloads an archive and checks it using `sha256sum -c` before extraction. Therefore, that specific pipeline is not classified as remote shell execution. Its checksum is nevertheless obtained from the same distribution endpoint as the archive, so an independently pinned checksum would provi ...[truncated 1496 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin every executable dependency to a reviewed exact version, for example: ```bash npm install -g @iqinghu/qhkit@<reviewed-version> ``` 2. Record and verify package integrity hashes or signatures before installation. Use a lockfile where possible. 3. Remove `@latest` and prohibit automatic upgrades based solely on remote error messages. 4. Avoid `npx --yes`, which downloads and executes packages without interactive review. Use a locally installed, pinned binary instead. 5. Prefer a preinstalled and administrator-vetted `qhkit` executable. If installation is necessary, obtain explicit user approval before executing package-manager commands. 6. Install packages into an isolated, nonprivileged environment rather than globally. 7. Pin and verify Pillow and `sharp-cli` versions. Prefer already installed image-processing tools over dynamic installation during a Skill run. 8. Use only an approved registry. Do not silently switch to alternate mirrors; require explicit approval and equivalent integrity verification. 9. Run third-party tooling in a sandbox with restricted filesystem access, a minimal environment, and outbound-network controls. 10. Independently pin the expected Node.js archive checksum in the reviewed Skill rather than relying exclusively on a checksum fetched from the same distribution origin. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:67
Finding
API Token Is Requested Through Chat and Passed on the Command Line<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 67–73 **Vulnerability Type**: `T09: Insecure Skill Coding Practices` **Risk Level**: Medium ### Vulnerable Code The Skill instructs the user to send the generated API key to the agent and then configures it with: ```bash qhkit config set --token <API-key> --env prod ``` It alternatively permits: ```bash QHKIT_TOKEN=<API-key> ``` ### Technical Analysis The workflow asks the user to disclose a production API credential through the conversation. Secrets entered into chat may be retained in conversation history, logging systems, observability platforms, debugging traces, or downstream model-processing infrastructure. The command-line form also places the token in a process argument. Depending on operating-system configuration, process arguments may be visible to other local users through process-inspection utilities. The command may additionally be retained in shell history or agent execution logs. An environment variable is preferable to a command-line argument but is not automatically safe. It may still be inherited by child processes, exposed through diagnostic output, or captured in process dumps. The Skill does not prescribe private interactive entry, restrictive configuration-file permissions, log redaction, or token rotation after accidental disclosure. ### Attack Path 1. The user follows the Skill's directions and posts a production API token in the chat. 2. The token is retained in the transcript, agent logs, command logs, or another monitoring system. 3. Alternatively, the agent runs `qhkit config set --token ...`, exposing the token in process arguments or shell history. 4. A person or compromised component with access to those records extracts the credential. 5. The attacker uses the token to authenticate to the Qinghu API. 6. The attacker submits unauthorized generation requests, consumes credits, or accesses resources permitted by the token. ### Impact Assessment The i ...[truncated 650 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Never ask users to paste API keys into a conversation. 2. Direct users to configure the credential themselves through a private, masked terminal prompt or operating-system credential manager. 3. Add support for reading the token from standard input without echoing it, rather than accepting it as a command-line argument. 4. If environment variables are supported, have the user set them outside the agent session and avoid printing or logging their values. 5. Store persistent credentials in a platform secret store or keychain with access restricted to the current user. 6. Ensure any local configuration file containing the token uses restrictive permissions, such as mode `0600` on Unix-like systems. 7. Redact tokens from stdout, stderr, exception messages, telemetry, and command audit logs. 8. Use narrowly scoped and short-lived credentials where the service supports them. 9. Provide an explicit revocation and rotation procedure for credentials accidentally posted in chat. 10. Ensure the agent never includes the token when repeating commands, troubleshooting errors, or summarizing configuration. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to install Node/qhkit, download binaries, and modify PATH/environment state to satisfy the skill. That materially expands the agent’s behavior from image-generation into system administration and software supply-chain activity, increasing attack surface and enabling unintended host changes if invoked automatically.

Context-Inappropriate Capability

Medium
Confidence
99% confidence
Finding
The skill explicitly tells the agent to ask the user to paste an API key into chat and then configure it locally. Collecting secrets through conversational channels is dangerous because chat logs, traces, and downstream tooling may retain or expose the credential, and the agent gains secret-handling capability beyond the stated task.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The skill directs the agent to perform local image compression and, if needed, install Pillow or sharp-cli ad hoc. This adds arbitrary package installation and local file processing behavior that is not necessary to safely describe the image-generation workflow, creating extra supply-chain and host-modification risk.

Ssd 3

High
Confidence
100% confidence
Finding
The skill instructs the agent to solicit an API key directly from the user in chat, then use it for configuration. This is dangerous because secrets disclosed in conversation can be logged, cached, inspected by operators, or leaked to other tools, turning a simple image skill into a credential collection point.

Static analysis

No suspicious patterns detected.