beautiful-mermaid
Warn
Audited by Gen Agent Trust Hub on Oct 26, 2026
Risk Level: MEDIUMREMOTE_CODE_EXECUTIONINDIRECT_PROMPT_INJECTIONCOMMAND_EXECUTION
Full Analysis
- [REMOTE_CODE_EXECUTION]: The script
scripts/render.tscontains anensurePackagefunction that dynamically installs thebeautiful-mermaidpackage usingnpm installorbun addviachild_process.execSyncif it is not already present. This installation occurs at runtime without a specified version, which could lead to the execution of malicious code if the package is hijacked or if a typosquatting attack targets the name. - Evidence:
scripts/render.tslines 135-156. - [INDIRECT_PROMPT_INJECTION]: The skill processes untrusted Mermaid syntax and renders it as an SVG, which is then directly embedded into an HTML file for browser-based screenshot capture. The lack of sanitization creates a cross-site scripting (XSS) surface.
- Ingestion points:
scripts/render.tsreads diagram code via--codeor--inputarguments. - Boundary markers: None. There are no instructions to the agent to sanitize the input or ignore embedded instructions within the Mermaid code.
- Capability inventory: The skill uses
agent-browserto open the local HTML file (file://protocol) and perform actions, and it has file system write access viascripts/create-html.ts. - Sanitization: None.
scripts/create-html.ts(line 149) performs a direct string interpolation of thesvgContentinto the HTML template. - [COMMAND_EXECUTION]: The skill uses
child_process.execSyncto execute shell commands for package management. Additionally, theSKILL.mdworkflow instructs the agent to execute multiple shell commands includingrm,bun run, andagent-browserCLI commands.
Audit Metadata