Back to skill

Security audit

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

Security checks for vulnerabilities and agentic risk

Overview

This Lazada image-generation skill is purpose-aligned, but it needs review because it asks for an API key in chat and installs or upgrades unpinned command-line tools globally.

Install only if you are comfortable using qhkit and Qinghu AI for Lazada image generation. Configure the API token through a local environment variable or protected secret mechanism instead of pasting it into chat, review any package installation or upgrade before allowing it, and expect product images to be uploaded to the external service and paid credits to be consumed after confirmation.

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## Vulnerability Details **File Location**: `SKILL.md`, lines 54-57, 80, and 93 **Vulnerability Type**: Unpinned dependencies and automatic package execution **Risk Level**: Medium ### Vulnerable Code Snippets ```bash npm i -g @iqinghu/qhkit ``` ```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 INPUT_FILE -o OUTPUT_FILE.jpg resize 2048 ``` The instructions also permit executing `@iqinghu/qhkit` through `npx` and switching npm operations to `https://registry.npmmirror.com`. ### Technical Analysis These commands resolve package versions dynamically at installation time. In particular, `@latest` and `npx --yes` permit a newly published package version to be downloaded and executed without prior review. No lockfile, exact version, or package-integrity value constrains the effective code. Package installation and execution can invoke package lifecycle scripts and runtime code with the permissions of the Agent process. Global npm installation also modifies the user's shared command environment, which exceeds the minimum scope required for a single Skill invocation. The use of multiple package mirrors increases the number of supply-chain systems that must remain trustworthy. The checksum-verified Node.js download at lines 62-67 is not the source of this finding. That archive uses a fixed version, is obtained from the official Node.js distribution service or a documented mirror, and must pass SHA-256 verification before extraction. ### Attack Path 1. An attacker compromises a package maintainer account, registry, mirror, or an upstream dependency. 2. The attacker publishes a malicious version of `@iqinghu/qhkit`, `sharp-cli`, Pillow, or a transitive dependency. 3. The Agent follows the Skill instructions and invokes an unpinned install, `@latest`, or `npx --yes`. 4. The registry resolves the malicious version ...[truncated 876 chars]
Remediation
## Remediation Suggestions 1. Pin every dependency to an exact reviewed version rather than using floating versions or `@latest`. 2. Record and verify package integrity hashes through a lockfile or equivalent trusted manifest. 3. Remove automatic `npx --yes` execution. Install a reviewed version in an isolated project directory before invoking it. 4. Prefer a local, non-global npm installation so the Skill does not modify the user's shared command environment. 5. Run package installation and image processing inside a sandbox with restricted filesystem and network access. 6. Disable package lifecycle scripts during installation where compatible, then explicitly execute only reviewed entry points. 7. Use one documented trusted registry. If mirrors are necessary, establish equivalent integrity and provenance controls. 8. Pin Pillow and `sharp-cli` versions as well as the primary `qhkit` package. 9. Require explicit user approval before installing or upgrading executable dependencies.

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-74 **Vulnerability Type**: Insecure secret collection and command-line secret exposure **Risk Level**: Medium ### Vulnerable Code Snippet The Skill instructs the user to generate an API key and send it to the Agent, after which the Agent is directed to run: ```bash qhkit config set --token API_KEY --env prod ``` It alternatively mentions the `QHKIT_TOKEN` environment variable, but does not require the safer mechanism or prohibit disclosure through chat. ### Technical Analysis API credentials are sensitive authentication material and should not be transferred through ordinary conversation text. A token pasted into the conversation may be retained in chat records, Agent traces, telemetry, debugging output, or model context. Passing the token directly through `--token` creates an additional exposure channel. Depending on the host platform and shell configuration, command-line arguments may be visible in process listings, execution traces, audit logs, terminal history, or orchestration logs. The token may consequently remain accessible after configuration has completed. The Skill uses the token to access a paid cloud image-generation service. Therefore, disclosure could allow an unauthorized party to consume credits or exercise any other API capabilities granted to that credential. ### Attack Path 1. The Skill tells the user to copy the Qinghu API key and send it to the Agent. 2. The token is stored or propagated in conversation history, Agent context, telemetry, or execution logs. 3. The Agent interpolates the token into the `qhkit config set --token` command. 4. The full command may additionally become visible through process inspection, shell history, or command logging. 5. A person or process with access to one of these records extracts the token. 6. The exposed token is reused to authenticate to the associated service and submit paid requests or pe ...[truncated 595 chars]
Remediation
## Remediation Suggestions 1. Do not ask users to paste API keys into ordinary chat messages. 2. Integrate with a platform-provided secret manager or protected credential-entry interface. 3. Prefer reading the token from protected standard input or a permission-restricted configuration file instead of a command-line argument. 4. If an environment variable is required, inject it through the execution platform's secret facility rather than displaying or echoing it in the conversation. 5. Redact tokens from command traces, telemetry, exception messages, process logs, and configuration output. 6. Ensure any stored credential file is created with access restricted to the current user. 7. Provide instructions for immediate token revocation and rotation if a user has already disclosed a token in chat. 8. Use narrowly scoped, short-lived credentials where the service supports them. 9. Confirm that `qhkit config show` never returns the complete token and add automated tests for secret redaction.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

Medium
Confidence
91% confidence
Finding
The skill metadata says requests for Lazada product images or related platform images 'must trigger' the skill, using broad keyword-style activation criteria. That can cause overbroad invocation and route users into external tool flows, installation steps, and credential-handling paths even when the user may only be asking for advice or comparison, increasing the chance of unnecessary external actions and data exposure.

Natural-Language Policy Violations

Medium
Confidence
82% confidence
Finding
The instruction to make language follow the site automatically removes user choice over output language and localization. In a cross-border commerce context this can cause unintended disclosure, misleading content, or incorrect market-facing assets if the assumed site/language does not match the seller's intent.

Ssd 3

Medium
Confidence
98% confidence
Finding
The skill explicitly instructs the agent to ask the user to paste an API key into chat and then use it to configure the CLI. Collecting secrets through the conversation channel is dangerous because chat logs may be retained, exposed to other systems, or mishandled by the agent, leading to credential compromise and unauthorized use of the user's account.

Static analysis

No suspicious patterns detected.