Back to skill

Security audit

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

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but it asks for sensitive API credentials through chat and installs mutable command-line packages globally at runtime.

Install only if you are comfortable with qhkit being installed or upgraded on the machine and with product images being sent to Qinghu for generation. Do not paste a real API key into chat; configure it privately through a protected environment variable or local credential mechanism, and prefer a limited, revocable key with spending controls.

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:50
Finding
Unpinned Third-Party Packages Are Installed and Executed at Runtime## Vulnerability Details **File Location**: `SKILL.md:50-57`, `SKILL.md:77-83`, and `SKILL.md:93` **Vulnerability Type**: Supply-chain exposure through mutable third-party dependencies **Risk Level**: High ### Vulnerable Code ```bash 2. **No qhkit but node/npm is available** → Global installation: npm i -g @iqinghu/qhkit **Upgrade**: npm i -g @iqinghu/qhkit@latest ``` The image-compression fallback also installs or executes unpinned packages: ```bash python -c "from PIL import Image, ImageOps; im=ImageOps.exif_transpose(Image.open('original')); im.thumbnail((2048,2048)); im.convert('RGB').save('compressed.jpg', quality=85)" # If Pillow is missing: pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple # If Python is unavailable: npx --yes sharp-cli -i original -o compressed.jpg resize 2048 ``` ### Technical Analysis The Skill instructs the Agent to install or execute mutable third-party packages during task execution. No exact package versions, lockfile, integrity hashes, or reviewed artifact digests are specified. `npm i -g` also installs the CLI globally for the current user or system, depending on the npm configuration. This creates a broader and longer-lived change than a task-scoped installation. The explicit use of `@latest` makes the executed package dependent on whichever release is current when the Skill runs. The Pillow and `sharp-cli` fallback paths have the same issue. `npx --yes` can download and immediately execute a package without an interactive confirmation. Alternate npm and Python package mirrors add additional supply-chain trust boundaries. This finding concerns package-manager execution, not the checksum command at line 63. The following flagged command does not pipe a script into a shell: ```bash curl -fsSL https://nodejs.org/dist/v22.22.3/SHASUMS256.txt | grep ' node-v22.22.3-linux-x64.tar.xz$' | sha256sum -c - ``` It sends checksum metadata to `grep` a ...[truncated 1679 chars]
Remediation
## Remediation Suggestions 1. Pin every dependency to a reviewed exact version; do not use `@latest` or unconstrained package names. 2. Record and verify package integrity hashes or use a lockfile with integrity metadata. 3. Avoid global npm installation. Use a dedicated, non-privileged, task-scoped directory or isolated container. 4. Require explicit user approval before installing or upgrading executable dependencies. 5. Prefer a preinstalled, reviewed `qhkit` release rather than downloading code during Skill execution. 6. Pin Pillow and `sharp-cli` versions and validate their artifacts before execution. 7. Avoid `npx --yes` for packages that have not already been reviewed and cached. 8. Use a single trusted registry where possible. If mirrors are necessary, document their trust model and verify package integrity independently of the mirror. 9. Disable unnecessary package lifecycle scripts where compatible, for example by using npm's `--ignore-scripts` option after confirming the package does not legitimately require them. 10. Run image conversion and external CLIs in a sandbox with restricted filesystem, credential, and network access.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:69
Finding
API Token Is Requested Through Chat and Passed as a Command-Line Argument## Vulnerability Details **File Location**: `SKILL.md:69-75` **Vulnerability Type**: Insecure secret collection and command-line secret exposure **Risk Level**: High ### Vulnerable Code ```text 4. **Key**: When there is no key, send the following guidance to the user. After obtaining the key, execute: qhkit config set --token <key> --env prod 1. Open the registration/login page. 2. Go to the APIKeys page. 3. Create/copy a key, then send the API key to me. ``` ### Technical Analysis The Skill explicitly asks the user to send an API key through the conversation. Secrets entered into a conversational interface may be retained in chat history, Agent traces, observability systems, support exports, or model-provider logs. The subsequent command passes the token through the `--token` command-line option. Depending on the operating system and execution framework, command arguments may be visible through process inspection, command telemetry, debugging output, audit logs, or shell history. Although the document mentions `QHKIT_TOKEN` as an alternative, it still makes direct chat submission and a command-line argument part of the primary setup workflow. This exceeds the minimum exposure necessary to configure the image-generation service. ### Attack Path 1. The Skill tells the user to create and send an API key to the Agent. 2. The user submits the plaintext token in the conversation. 3. The conversation or Agent execution trace retains the token. 4. The Agent constructs `qhkit config set --token <key> --env prod`. 5. The token may additionally appear in process arguments, command logs, shell history, or execution telemetry. 6. A person or service with access to any retained record extracts the token. 7. The exposed token is used to invoke the Qinghu service, consume account credits, or perform other operations authorized for that key. ### Impact Assessment The exposed credential gra ...[truncated 532 chars]
Remediation
## Remediation Suggestions 1. Do not ask users to paste API keys into the conversation. 2. Direct users to configure the credential privately outside the Agent session. 3. Prefer a hidden interactive prompt, standard input, operating-system credential store, or a protected configuration file with restrictive permissions. 4. If an environment variable is supported, instruct the user to set `QHKIT_TOKEN` in their private execution environment without revealing its value to the Agent. 5. Avoid passing secrets as command-line arguments. 6. Ensure command logging, shell tracing, and debug output are disabled while credentials are configured. 7. Redact token-like values from Agent traces, application logs, errors, and telemetry. 8. Store credentials with least-privilege filesystem permissions and avoid writing them to project directories. 9. Recommend narrowly scoped, revocable API keys with spending limits where the service supports them. 10. If a token has already been shared through chat or command logs, instruct the user to revoke and rotate it.
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
92% confidence
Finding
The metadata description says the skill 'must trigger' for broad classes of TikTok Shop image requests, which can cause the agent to invoke this external integration even when a user only generally wants image help. Overly broad mandatory-trigger language weakens intent matching, increases unnecessary third-party data exposure, and can bypass safer or more appropriate alternatives.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The trigger section lists broad examples like making TikTok product images, main images, detail images, or posters, but does not define when the skill should not run. In an agent environment, ambiguous activation rules can cause over-selection of this skill, leading to misrouting, unnecessary installation/execution steps, and unintended transfer of user-supplied images or prompts to the external service.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
The skill instructs the agent to send a fixed Chinese-language key-acquisition message to users when configuration is missing, without checking user language preference. This can confuse users, reduce informed consent around API key handling, and make them more likely to paste sensitive credentials into a conversation they do not fully understand.

Static analysis

No suspicious patterns detected.