Back to skill

Security audit

tldraw 板书工坊

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a tldraw drawing helper, but it exposes a local auth token and open document metadata to agent context, so users should review it before installing.

Install only if you are comfortable giving agents authenticated access to your running tldraw Desktop server. Treat ~/.config/tldraw/server.json and its token as sensitive, avoid logging or sharing it, and be cautious with any agent action that uses /exec or document scripts because it can change saved canvases.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
inject-server-context.sh:12
Finding

Bearer Token and Open-Document Metadata Exposed in Agent Context

Content
View full analysis
/dev/null) || exit 0 [ -n "$port" ] && [ -n "$token" ] || exit 0 context="The tldraw desktop canvas server is running at http://localhost:$port. Send the header 'Authorization: Bearer $token' on every request except GET / and /readme. Use these values directly — you do not need to read server.json." # Snapshot the open documents so the agent starts knowing what canvases exist. # Best-effort: a dead server, missing curl, or a slow response must not delay # or fail the subagent launch. docs="" if command -v curl >/dev/null 2>&1; then docs=$(curl -s --max-time 2 -X POST "http://localhost:$port/api/search" \ -H 'content-type: text/plain' \ -H "authorization: Bearer $token" \ --data-binary 'return await api.getDocs()' 2>/dev/null | jq -c '.result // empty' 2>/dev/null) fi if [ -n "$docs" ] && [ "$docs" != "[]" ]; then context="$context The user's currently open tldraw offline canvases (most-recently-active first): $docs" fi jq -n --arg event "$event" --arg context "$context" \ '{hookSpecificOutput: {hookEventName: $event, additionalContext: $context}}' ``` ### Technical Analysis The hook reads the tldraw bearer token from `/home/fslong/.config/tldraw/server.json` and interpolates it directly into `additionalContext`. It also uses that credential to retrieve the list of open documents and adds the returned metadata to the same model-visible context. The bearer token authorizes local API operations beyond simple document discovery. The documented API includes endpoints that execute JavaScript, edit and save documents, create files, and install persistent document-level scripts. Consequently, the token should be treated as a sensitive session credential. Al ...[truncated 2096 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (17)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is the most serious issue: the declared purpose is a visual/layout skill, but the detected behavior includes reading local configuration, extracting an auth token, injecting that token into agent context, and making requests to a local tldraw server. Hidden credential access and context injection materially exceed user expectations and can expose secrets or enable unauthorized actions against local services.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script reads a bearer token from a local config file and injects it into additionalContext, explicitly telling downstream agents to use it on every request. This unnecessarily exposes a live authentication secret to the agent prompt/context layer, where it may be logged, propagated to subagents, or mishandled by prompt injection, enabling unauthorized access to the local tldraw canvas server and user documents.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 7)May include surrounding context.

The shared skill is installed at:

text
~/skills/tldraw-offline/SKILL.md

Agents should read that file before touching open tldraw Desktop canvases. Vendor-specific copies or pointers may also be installed under ~/.codex, ~/.claude, ~/.cursor, ~/.gemini (Gemini CLI and Antigravity), and ~/.pi/agent.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
80% confidence
Finding

The skill instructs the operator to use shell/network-capable behavior (curl http://localhost:7236/readme) and references local server interaction, but it declares no explicit tool scope or permission boundary. In an agent setting, undeclared shell capability increases the chance that the skill can trigger local command execution or network access without clear user/admin review, which weakens least-privilege controls.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest trigger list includes generic terms like “笔记”, “讲课”, and “知识整理”, which are common phrases that could match many unrelated conversations. The file does not provide trigger constraints, activation boundaries, or negative examples to clarify when this skill should or should not activate.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · inject-server-context.sh (reported line 21)May include surrounding context.

sh
# Best-effort: a dead server, missing curl, or a slow response must not delay
# or fail the subagent launch.
docs=""
if command -v curl >/dev/null 2>&1; then
  docs=$(curl -s --max-time 2 -X POST "http://localhost:$port/api/search" \
    -H 'content-type: text/plain' \
    -H "authorization: Bearer $token" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The API reference states that /api/doc/:id/exec can perform in-place edits on a document and examples include saving changes, but it does not warn that this endpoint mutates user data. In an agent skill, this omission is risky because an automated consumer may treat the endpoint as routine and make destructive or unintended edits without confirmation, backup, or preview.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation explicitly instructs users to read a bearer token from a local config file and use it in API calls, but it does not warn that this token is a sensitive credential that grants access to the local tldraw service. In a skill context, exposing credential-handling patterns without safety guidance increases the chance that downstream agents or users will reuse, log, or leak the token, enabling unauthorized document access or modification.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · modules/02-api.md (reported line 22)May include surrounding context.

md
TOKEN=$(jq -r .token '/home/fslong/.config/tldraw/server.json')

# 查某文档
curl -s -X POST http://localhost:$PORT/api/search \
  -H 'content-type: application/json' \
  -H "authorization: Bearer $TOKEN" \
  -d '{"code":"return await api.getDocs({ name: \"NAME\" })"}'

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · modules/04-install.md (reported line 61)May include surrounding context.

Debian 系

bash
sudo dpkg -i tldraw-offline_1.12.0_amd64.deb

Arch 系(Manjaro)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document explicitly states that the skill relies on ~/.config/tldraw/server.json to obtain an API authentication token, but it does not warn that this file contains sensitive credentials or instruct users to protect it. In an agent/skill context, normalizing access to a local token file can encourage unsafe handling, accidental disclosure, or overbroad file access by other tools or users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script extracts a bearer token from a local config file and uses it in authenticated curl requests, which is a sensitive credential access plus network transmission path. There is no confirmation prompt, user-facing log, or explanatory warning in the file comments beyond terse usage examples.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · tq (reported line 13)May include surrounding context.

text
url="http://localhost:$port$2"
auth="authorization: Bearer $token"
if [ -z "$3" ]; then
  curl -s -X "$1" "$url" -H "$auth"
else
  case "$3" in
    '{'*) ctype='content-type: application/json' ;;

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, and there is no indication that the user can opt into another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy criteria, forcing a specific language without user opt-in is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file title and all template instructions are presented in Chinese, indicating the skill is tailored to produce Chinese educational content. Because there is no visible opt-in, language-selection mechanism, or stated region-specific justification in this file, it can violate the policy against forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

All user-facing instructions in the file are in Chinese, and there is no indication that the skill supports other languages or that Chinese-only output is an intentional, justified regional constraint. Per the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.