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.ts contains an ensurePackage function that dynamically installs the beautiful-mermaid package using npm install or bun add via child_process.execSync if 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.ts lines 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.ts reads diagram code via --code or --input arguments.
  • 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-browser to open the local HTML file (file:// protocol) and perform actions, and it has file system write access via scripts/create-html.ts.
  • Sanitization: None. scripts/create-html.ts (line 149) performs a direct string interpolation of the svgContent into the HTML template.
  • [COMMAND_EXECUTION]: The skill uses child_process.execSync to execute shell commands for package management. Additionally, the SKILL.md workflow instructs the agent to execute multiple shell commands including rm, bun run, and agent-browser CLI commands.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Oct 26, 2026, 06:31 PM