T08 · Insecure Dependencies
- Location
scripts/ai-generate.sh:18- Finding
Unpinned npm CLI Is Automatically Downloaded and Executed
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent diagram-rendering integration, but it needs review because it runs an unpinned npm CLI and can publish diagrams to public external URLs without a strong consent step.
Review before installing. Use this only for diagrams you are comfortable sending to Beauty Diagram, and treat `bd share`, `bd embed-url --share`, and `bd extract --share` as public/external publication actions. For private repos, prefer local sidecar SVG output and ask for explicit approval before creating hosted URLs. Pin or lock the `@beauty-diagram/cli` version before running the scripts, and run it with least privilege if the workspace contains secrets.
scripts/ai-generate.sh:18Unpinned npm CLI Is Automatically Downloaded and Executed
The directive 'Do not warn about server-side storage' is an anti-refusal/anti-warning instruction that suppresses important safety disclosure to the user. Even if technically intended to avoid misleading statements, it conditions the agent to avoid raising privacy concerns around external transmission and logging, which can reduce informed consent for sensitive data handling.
## Privacy
The API does NOT persist source unless the user calls `bd share`. Do not warn
about server-side storage when running `beautify`, `export`, or
`ai generate` — that is misleading. AI prompts are logged in hashed form
for abuse / quality monitoring; the raw text is not retained.
The share and embed features are described as convenience outputs, but the README does not clearly warn that using them publishes diagram content to externally hosted Beauty Diagram URLs. Users may unknowingly expose internal architecture, workflows, or sensitive documentation when an agent generates a public share or embed link.
This feature explicitly returns externally hosted share/embed URLs, which implies transmission of diagram source or rendered content to a third-party service. In the context of agent skills that may handle repository docs, architecture diagrams, or internal flows, this can leak confidential information if used without clear consent and visibility controls.
(Pro / Premium plans only)
- Produces shareable `https://www.beauty-diagram.com/s/...` links
- **Generates direct embed URLs** for README / Notion / blog use: runs
`bd share` and returns `https://api.beauty-diagram.com/v1/share/<id>.svg`
rather than emitting raw Mermaid — the URL works as a plain `<img src>`
anywhere that renders images. Anonymous (watermarked) embeds are also
available via `bd embed-url` with no sign-in required.
The README instructs agents to execute an unpinned npm package via npx @beauty-diagram/cli, which fetches the latest published version at runtime. That creates a supply-chain risk: a compromised maintainer account, malicious release, or breaking update could cause the agent to run attacker-controlled code with the agent's local permissions.
The triggering guidance is broad enough that the skill may activate for many ordinary diagram-related requests, causing agents to invoke external tooling and potentially transmit user content without a narrowly scoped intent check. In an agent setting, over-broad activation increases the chance of unintended tool use, unnecessary command execution, and accidental disclosure through follow-on features like share or embed.
The example instructs the agent to create an embed URL with --share, which normalizes publishing diagram output to an external service and then inserting that public URL into a README. This creates a realistic path for unintentional disclosure because users may copy the example without appreciating that internal design data is being hosted off-platform.
Agent (uses skill, Pro/Premium plan):
$ bd embed-url ./architecture.mmd --share
→ https://api.beauty-diagram.com/v1/share/abc12345xyz0.svg
Injects into README:
The README injection example embeds a third-party hosted image URL directly into project documentation, which can expose private architecture details to anyone with access to the rendered document or repository and may create persistent external dependencies. It also encourages agents to modify docs in a way that silently links internal content to an outside service.
Agent (uses skill, Pro/Premium plan):
$ bd embed-url ./architecture.mmd --share
→ https://api.beauty-diagram.com/v1/share/abc12345xyz0.svg
Injects into README:
See `examples/` for runnable diagram sources and `scripts/` for shell
The trigger description is very broad and includes common requests like producing SVGs, rendering folders, README embeds, and generating diagrams from text. Overbroad activation can cause the agent to invoke this skill in situations where users did not explicitly consent to using an external API, increasing chances of unnecessary data transmission or unintended file modifications.
The skill description promotes rendering, AI generation, and public sharing but does not clearly warn at the point of use that diagram source and prompts may be sent to a third-party public API. That omission can lead the agent to transmit sensitive architecture diagrams, internal docs, or prompts off-host without meaningful user awareness.
The skill instructs use of npx @beauty-diagram/cli without pinning a version, which allows fetching whatever version is latest at execution time. If the package is compromised, updated maliciously, or a breaking release is published, the agent could execute unreviewed code and exfiltrate repository data or secrets during an otherwise routine diagram task.
Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.
- Need a shareable link: `bd share <file> --title "..."`
3. **Run the command.** Always write to a file (`--out`) rather than letting
the SVG flood the terminal / chat. AI generation can also pipe directly
into beautify: `bd ai generate "..." | bd beautify - --out flow.svg`.
4. **Verify the result exists** before reporting success. If the command
This section instructs use of API-backed commands and share endpoints that transmit diagram source or prompts to an external service. In a diagram skill this behavior is expected, but it still creates real data egress risk if users provide confidential diagrams, internal architecture, or proprietary prompts.
# One-shot saved share embed (clean output for pro/premium owners).
# Saves the diagram via /v1/share AND prints the embed URL in one step.
bd embed-url docs/architecture.mmd --share
# → prints https://api.beauty-diagram.com/v1/share/<token>.svg
# AI: generate a diagram from a text prompt. Output is Mermaid source —
# always write to a file so the user can iterate. Paid-only.
Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.
bd extract README.md
# Share mode: mint /v1/share/<token>.svg per fence. Watermark-free for Pro/Premium.
# 1 share quota per unique source (cached locally; re-runs free). No size cap.
# Requires API key. Default keeps existing share tokens across re-runs;
# use --re-mint to force fresh tokens (e.g. collaborator taking ownership).
bd extract README.md --share
The embed flow explicitly tells the agent to save diagrams and construct public share URLs, which can expose internal content on a publicly accessible endpoint if used on non-public repository material. Because the trigger examples include common documentation scenarios like README and blog embeds, the risk of accidental publication is elevated in normal use.
When the user asks for "a GitHub README diagram", "embed in Notion", "embed in my blog post", "an `<img>` of this diagram", or "a URL that renders my diagram", route to the embed flow rather than emitting raw mermaid:
1. If the diagram is unsaved, run `bd share <file>` to save it.
2. Construct the embed URL: `https://api.beauty-diagram.com/v1/share/<share-token>.svg`.
3. For one-off / quick embeds without saving, use `bd embed-url <file>` and recommend the inline URL (note that anonymous embeds carry a "Powered by Beauty Diagram" watermark).
**Easier one-shot path:** `bd embed-url <file> --share` saves the diagram AND prints the embed URL in one command — no need to run `bd share` separately and then construct the URL by hand. Prefer this when the user wants a clean share embed.
The worked example normalizes replacing local Mermaid with a remote image URL hosted by a third party. That can publish diagram contents externally and also introduces an external dependency into project documentation, which may leak access patterns and expose sensitive architecture details to anyone with the URL.
Agent steps:
1. Use the one-step path: `bd embed-url ./architecture.mmd --share`
→ saves the diagram and prints the embed URL, e.g.
`https://api.beauty-diagram.com/v1/share/abc12345xyz0.svg`
2. Replace the raw mermaid block in README with:
``
3. (Optional) Confirm with the user that watermark behavior matches their plan
The example instructs inserting a public api.beauty-diagram.com image URL directly into the README, reinforcing a workflow that republishes diagram content through a third-party host. In contexts where READMEs or docs contain internal system diagrams, this can create unintended disclosure and persistent external exposure.
→ saves the diagram and prints the embed URL, e.g.
`https://api.beauty-diagram.com/v1/share/abc12345xyz0.svg`
2. Replace the raw mermaid block in README with:
``
3. (Optional) Confirm with the user that watermark behavior matches their plan
(free owner → watermarked; pro/premium owner → clean).
The script executes npx --yes @beauty-diagram/cli without pinning an exact package version, so every run may fetch and execute whatever version is currently published to npm. If the package is compromised, typo-squatted, or a malicious update is released, this becomes arbitrary code execution in the user's environment, which is especially risky in an automation skill that encourages direct CLI use.
This second unpinned npx invocation has the same supply-chain risk: it resolves and runs the latest published CLI at execution time rather than a vetted immutable version. Because the command processes user-provided diagram input and runs as part of a rendering workflow, a compromised upstream package could execute arbitrary code, exfiltrate files, or tamper with outputs.
The script executes npx --yes @beauty-diagram/cli without pinning an exact package version, so each run may fetch and execute whatever package version is currently published. If the package, a dependency, or the registry resolution path is compromised, this becomes a remote code execution path on the host running the script. In this skill context, the command is meant to be run on local documentation folders, which increases exposure because users may execute it in trusted developer environments or CI.
The script executes npx --yes @beauty-diagram/cli without pinning an exact package version, so each run may fetch and execute whatever version is currently published to the registry. If the package is compromised, a maintainer account is hijacked, or a malicious version is published, users running this script would execute attacker-controlled code on their machine or CI environment.
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"access": "public"
},
"dependencies": {
"clawhub": "^0.9.0"
}
}
No suspicious patterns detected.