T09 · Insecure Skill Coding Practices
- Location
SKILL.md:12- Finding
Obsidian API Bearer Key Stored in Plaintext Workspace Documentation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12-24
Vulnerability Type: Plaintext storage of a privileged API credential
Risk Level: HighVulnerable Code
markdown 1. Check TOOLS.md for existing `OBSIDIAN_API_URL` and `OBSIDIAN_API_KEY` 2. If not found: - Get Windows host IP: `cat /etc/resolv.conf | grep nameserver | awk '{print $2}'` - Ask user for API Key - Save to TOOLS.md: ```markdown ### Obsidian REST API (WSL → Windows) **API 端点**: https://<detected-ip>:27124 **API Key**: <user-provided-key> ``` 3. Test connection with saved configThe credential is subsequently extracted directly from the plaintext file at
SKILL.md, lines 36-39:bash # Get URL and KEY from TOOLS.md URL=$(grep 'API 端点' ~/.openclaw/workspace/TOOLS.md | awk -F': ' '{print $2}') KEY=$(grep 'API Key' ~/.openclaw/workspace/TOOLS.md | awk -F': ' '{print $2}')Technical Analysis
The Skill explicitly directs the agent to persist a user-provided bearer key in
~/.openclaw/workspace/TOOLS.md. This is a general workspace Markdown file rather than a credential manager or access-controlled secret store.The key authorizes operations against the Obsidian Local REST API. According to the bundled API documentation, authenticated clients can read, create, overwrite, append to, partially modify, and delete vault files. They can also interact with the active file and invoke exposed Obsidian commands.
Any process, agent, extension, backup service, synchronization mechanism, or user that can read the workspace file can recover the credential. Because it is a bearer token, possession is sufficient for authentication without an additional proof of identity.
Attack Path
- The user supplies an Obsidian Local REST API key.
- The Skill writes the key into
~/.openclaw/workspace/TOOLS.mdas plaintext. - An attacker or untrusted local component ob ...[truncated 1130 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not store bearer keys in
TOOLS.md, other workspace documentation, source files, or shell history. - Store the key in an operating-system credential manager or a dedicated secret-management facility.
- If file-based storage is unavoidable, use a separate secret file outside the shared workspace, restrict it to the owning user with mode
0600, and ensure that it is excluded from synchronization, version control, backups, and diagnostic bundles. - Load the key through a protected environment variable or secret-injection mechanism without printing it.
- Redact Authorization headers and credential values from logs, tool output, and error reports.
- Rotate any key that has already been written to a broadly accessible workspace file.
- Use a dedicated key with the narrowest permissions supported by the plugin and establish a regular rotation procedure.
- Do not store bearer keys in
