Back to skill

Security audit

dmxapi-image-generation

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward DMXAPI image-generation helper, but users should review the external CLI install and API key handling before use.

Install only if you trust DMXAPI and the dmxapi-cli npm package. Prefer a pinned or local CLI install where possible, use a limited and revocable API key, and avoid sending sensitive prompts or private images unless that data sharing is acceptable.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:15
Finding
Unpinned Global Installation of a Third-Party CLI## Vulnerability Details **File Location**: `SKILL.md`, lines 15–18 **Vulnerability Type**: Unpinned globally installed third-party dependency **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown 1. 安装 CLI 工具(需要 Node.js 20+): ```bash npm install -g dmxapi-cli ``` ``` ### Technical Analysis The skill instructs users or agents to globally install `dmxapi-cli` from the npm registry without specifying an exact version or verifying package integrity. As a result, the code installed at execution time may differ from the code that existed when the skill was reviewed. npm packages can define lifecycle scripts that run during installation with the privileges of the invoking user. Global installation also makes the package broadly available in the user's environment. The project provides no lockfile, integrity hash, vendored source, or other mechanism for reviewing and reproducing the installed dependency. This creates a supply-chain exposure: a compromised maintainer account, malicious package release, registry compromise, or unexpected future update could cause attacker-controlled code to execute during installation or subsequent CLI use. The API-key configuration instruction immediately following installation increases the potential consequence, although the reviewed file does not itself demonstrate credential exfiltration. ### Attack Path 1. An attacker compromises the `dmxapi-cli` package, its publisher account, or its distribution channel and publishes a malicious release. 2. A user or agent follows the skill instruction and runs `npm install -g dmxapi-cli`. 3. Because no exact version or integrity value is specified, npm resolves and installs the attacker-controlled release. 4. Malicious npm lifecycle code may execute during installation with the invoking user's privileges, or malicious logic may execute when the CLI is used. 5. The user subsequently configures a DMXAPI key through the installed CLI, giving a malicious package an oppor ...[truncated 766 chars]
Remediation
## Remediation Suggestions 1. Pin `dmxapi-cli` to an exact, reviewed version rather than installing the latest available release: ```bash npm install --save-exact dmxapi-cli@<reviewed-version> ``` 2. Prefer a project-local installation over `npm install -g` to reduce system-wide exposure and support reproducible dependency management. 3. Commit an npm lockfile and require integrity verification during installation, such as through `npm ci`. 4. Verify the package's official name, publisher, provenance, signatures, and release history before recommending it. 5. Audit package contents and lifecycle scripts for each approved update. 6. Disable lifecycle scripts during installation where compatible: ```bash npm ci --ignore-scripts ``` 7. Document how the CLI stores and protects API keys. Use restricted, revocable keys with minimal quota and permissions, and avoid exposing keys through command history, logs, or plaintext project files. 8. Consider distributing reviewed source or a verified artifact with a checksum so that installed behavior can be tied to the audited version.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (1)

Vague Triggers

Medium
Confidence
94% confidence
Finding
The skill description is broadly scoped around common user intents like generating or editing images, which can overlap with ordinary conversation and cause the agent to invoke the skill when the user did not explicitly request external image-generation actions. In this context, unintended activation can lead to unnecessary outbound API use, unexpected file creation, and transmission of user prompts or local image paths to a third-party service.

Static analysis

No suspicious patterns detected.