T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:27
- Finding
- External Disclosure of Mermaid Diagram Source Through URL-Based Rendering## Vulnerability Details **File Location**: `SKILL.md`, lines 27–32 and 57–63 **Vulnerability Type**: Sensitive information exposure to a third-party rendering service **Risk Level**: Medium **Vulnerable Code Snippet**: ```bash mkdir -p /home/bcaddy/.openclaw/workspace/diagrams ENCODED=$(cat <input.mmd> | base64 -w 0) curl -s "https://mermaid.ink/img/${ENCODED}?bgColor=white&width=2048" \ -o /home/bcaddy/.openclaw/workspace/diagrams/<name>.png ``` The same unsafe rendering pattern is repeated later: ```bash ENCODED=$(cat /home/bcaddy/.openclaw/workspace/diagrams/<name>.mmd | base64 -w 0) curl -s "https://mermaid.ink/img/${ENCODED}?bgColor=white&width=2048" \ -o /home/bcaddy/.openclaw/workspace/diagrams/<name>.png ``` ### Technical Analysis The Skill directs the Agent to Base64-encode the complete Mermaid source and place it in the path of an HTTPS GET request sent to `mermaid.ink`. Base64 provides no confidentiality and can be trivially decoded by the rendering provider or any system retaining the URL. Diagram source may contain internal hostnames, private IP ranges, network segmentation, database locations, identity providers, authentication flows, service relationships, or other sensitive architectural information. URL paths may be retained in renderer access logs, reverse-proxy logs, observability platforms, network security products, and intermediary systems. The workflow does not require informed user consent, warn that source content is disclosed to a third party, classify or redact sensitive content, or provide a local-rendering default. ### Attack Path 1. A user requests a diagram containing confidential infrastructure or security-design information. 2. The Agent writes those details into a local `.mmd` file. 3. The prescribed command reads and Base64-encodes the complete file. 4. The encoded source is embedded directly into a request URL. 5. `curl` sends th ...[truncated 862 chars]
- Remediation
- ## Remediation Suggestions 1. Use a locally installed, version-pinned Mermaid CLI as the default renderer so diagram source does not leave the environment. 2. If remote rendering remains available, require explicit informed consent immediately before transmission and clearly identify the destination service and data being sent. 3. Scan and redact credentials, tokens, private keys, internal hostnames, private addresses, account identifiers, and sensitive topology before external submission. 4. Avoid embedding source in a GET URL. Use an appropriately secured request body where supported, while recognizing that this does not remove the third-party disclosure risk. 5. Document the renderer's privacy, retention, logging, and data-processing assumptions. 6. Provide a configuration option that prohibits all external rendering for confidential environments. 7. Fail safely if local rendering is unavailable rather than silently falling back to a remote service.
