Back to skill

Security audit

图像生成 Nano Banana 2

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed wrapper for a third-party image-generation CLI, with ordinary SaaS risks around API keys, file uploads, and npm installation.

Install this only if you trust dLazy and the @dlazy/cli npm package. Use npx or a sandboxed environment if you want to avoid a persistent global CLI, prefer per-invocation DLAZY_API_KEY for sensitive environments, and confirm before uploading local files because prompts and selected media are sent to dLazy-hosted services.

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
Execution of an Unverified Third-Party npm Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:5, 51-59`; mirrored in `SKILL-cn.md:5, 51-59` **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium ### Vulnerable Code From `SKILL.md:5` and `SKILL-cn.md:5`: ```json "install":"npm install -g @dlazy/cli@1.2.3", "installAlternative":"npx @dlazy/cli@1.2.3" ``` From `SKILL.md:51-59`: ```bash npx @dlazy/cli@1.2.3 <command> ``` ```bash npm install -g @dlazy/cli@1.2.3 ``` Equivalent installation commands are documented in `SKILL-cn.md:51-59`. ### Technical Analysis The Skill depends on the externally hosted npm package `@dlazy/cli` and instructs users or agents to retrieve and execute it through `npx` or install it globally. Pinning the package to version `1.2.3` reduces unreviewed version drift, but it does not provide artifact integrity or prove that the retrieved package matches reviewed source code. The audited project contains only the two Skill documents. It does not include the CLI implementation, a package lockfile, a cryptographic checksum, a verifiable signature, a vendored dependency, or other evidence that would allow the executable npm artifact to be audited or authenticated locally. Consequently, the behavior of the code actually executed during installation and invocation is outside the reviewed artifact. An attacker who compromises the published package version, the maintainer’s npm account, the package distribution process, or the registry delivery path could introduce malicious install lifecycle scripts or CLI logic. Such logic would execute under the identity and permissions of the user invoking `npm` or `npx`. This finding identifies an unverified supply-chain execution boundary. The audit did not establish that the current npm package is malicious. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or the artifact distribution path for `@dlazy/cli@1.2.3`. 2. The attacker adds malicious code to an installation lifecycle ...[truncated 1367 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Vendor the required CLI implementation into a reviewable repository or package it as an independently verifiable artifact. 2. Publish and verify a cryptographic digest or trusted signature for the exact package archive before execution. 3. Ensure that the npm artifact is reproducibly built from the referenced public source and document the verification procedure. 4. Prefer ephemeral, sandboxed execution over global installation. 5. Disable npm lifecycle scripts where they are not required, for example by using an installation method equivalent to `--ignore-scripts` after confirming that this does not break legitimate functionality. 6. Run the CLI under a dedicated low-privilege account or container with: - Access only to explicitly selected input and output files. - No unnecessary access to home-directory secrets. - Restricted environment variables. - Network access limited to documented service endpoints. 7. Avoid exposing unrelated credentials to the CLI process. Provide only the API credential required for the current task. 8. Add a lockfile or equivalent dependency manifest for all transitive dependencies and subject them to routine supply-chain scanning. 9. Prefer a local, verified binary path after installation rather than invoking `npx`, which may retrieve artifacts dynamically. 10. Document a package revocation and incident-response process so a compromised release can be blocked promptly. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (6)

Ae1

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

Vague Triggers

Medium
Confidence
92% confidence
Finding
The trigger keywords include very broad actions like '生成图片、编辑图片' and '文生图、图生图', which can cause the skill to activate in many ordinary image-related conversations without clear user intent to invoke this specific external CLI/API. Because this skill uploads prompts and possibly local files to remote services, over-broad routing increases the chance of unintended data exposure or unexpected external actions.

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.

Natural-Language Policy Violations

Medium
Confidence
78% confidence
Finding
The agent instruction requires specific user-facing responses in Chinese (“您必须明确告知用户...”) and does not offer a language or locale choice. This can violate language/locale policy when users have not opted into Chinese output.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger keywords include broad everyday phrases like "generate image, edit image" and "text to image, image to image," which can cause the skill to activate in contexts unrelated to this specific tool. In an agent setting, overly broad activation increases the chance of unintended execution of a network-enabled command that can upload local files and send user prompts to third-party services.

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.