Back to skill

Security audit

图像生成 Midjourney Imagine

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed dLazy image-generation CLI wrapper; the main caution is that it requires trusting a third-party npm CLI and sending selected prompts or files to dLazy.

Install only if you trust dLazy and the npm package `@dlazy/cli@1.2.3`. Prefer `npx` or an isolated install if you do not want a persistent global binary, and only pass prompts or local files that you are comfortable uploading to dLazy. Use a revocable API key and rotate it if the CLI or environment is no longer trusted.

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:5
Finding
Unverified Third-Party CLI Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:5, 54-60`; mirrored in `SKILL-cn.md:5, 54-60` **Vulnerability Type**: Third-party supply-chain exposure through npm/npx execution **Risk Level**: Medium ### Vulnerable Code From `SKILL.md:5`: ```json "install":"npm install -g @dlazy/cli@1.2.3", "installAlternative":"npx @dlazy/cli@1.2.3" ``` From `SKILL.md:54-60`: ```bash npx @dlazy/cli@1.2.3 <command> ``` ```bash npm install -g @dlazy/cli@1.2.3 ``` The same installation commands are declared in `SKILL-cn.md:5, 54-60`. ### Technical Analysis The Skill depends on registry-delivered code from the external `@dlazy/cli` npm package. Pinning the package to version `1.2.3` reduces unexpected version drift, but it does not cryptographically verify the downloaded artifact or protect against a compromised publisher account, compromised registry infrastructure, republished package artifact, or malicious package lifecycle scripts. Both documented installation methods can execute third-party code: - `npx @dlazy/cli@1.2.3` downloads and executes the package on demand. - `npm install -g @dlazy/cli@1.2.3` can run npm lifecycle scripts and persist the executable globally. The audited project contains only documentation and does not include the CLI implementation, an integrity hash, a signature-verification procedure, a lockfile, or a vendored and reviewed copy of the dependency. Therefore, the actual code executed by these commands cannot be verified from the audited artifact. ### Attack Path 1. An attacker compromises the npm publisher account, package release process, registry delivery path, or another component involved in distributing `@dlazy/cli@1.2.3`. 2. The attacker causes a malicious package artifact or lifecycle/runtime payload to be delivered under the expected package name and version. 3. A user or agent follows the Skill instructions and runs either: - `npm install -g @dlazy/cli@1.2.3`, or - `npx @dlazy/cli@1.2.3 ...`. 4. npm insta ...[truncated 1244 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Add artifact integrity verification** - Publish and document a trusted SHA-256 or stronger digest for the exact package artifact. - Verify the downloaded package archive before installation or execution. - Prefer signed releases and verify signatures against a documented maintainer key. 2. **Use reproducible dependency metadata** - Provide a lockfile containing npm integrity metadata. - Build releases through a reproducible and auditable process. - Document how the published npm artifact corresponds to a specific reviewed source commit. 3. **Avoid global installation by default** - Remove `npm install -g` as the recommended path. - Use a project-local, isolated installation with minimum filesystem permissions. - Run the CLI in a dedicated container or sandbox where practical. 4. **Restrict npm lifecycle behavior** - Use `--ignore-scripts` where the package functions without lifecycle scripts. - If scripts are required, document and audit each expected script before execution. 5. **Vendor or bundle reviewed implementation** - Include the necessary CLI source or a reviewed minimal client in the Skill package. - Ensure the included implementation is covered by the same security audit. 6. **Apply runtime least privilege** - Execute the CLI as an unprivileged account. - Limit access to unrelated files, credentials, environment variables, and network destinations. - Permit outbound connections only to the explicitly documented service endpoints when feasible. 7. **Document dependency verification** - Retain the existing provenance links, but supplement them with concrete verification commands, expected hashes, release signatures, and the exact source commit associated with version `1.2.3`. ]]>
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Ae1

High
Category
analysis-evasion
Content
[English](./SKILL.md) · [中文](./SKILL-cn.md)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Whitespace Padding

Medium
Category
Prompt Injection
Content
## 错误处理

| Code | 错误类型                         | 示例信息                                                                                                                 |
| ---- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| 401  | 未授权 (API Key缺失或无效)       | `ok: false, code: "unauthorized", message: "API key is missing or invalid"`                                                              |
| 501  | 缺少必填参数                     | `error: required option '--prompt <prompt>' not specified`                                                               |
Confidence
70% confidence
Finding
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Whitespace Padding

Medium
Category
Prompt Injection
Content
## Error Handling

| Code | Error Type                         | Example Message                                                                                                          |
| ---- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| 401  | Unauthorized (No API Key)          | `ok: false, code: "unauthorized", message: "API key is missing or invalid"`                                                              |
| 501  | Missing required parameter         | `error: required option '--prompt <prompt>' not specified`                                                              |
Confidence
70% confidence
Finding
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Static analysis

No suspicious patterns detected.