T09 · Insecure Skill Coding Practices
- Location
SKILL.md:30- Finding
Workspace-Wide Authentication Tokens Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Locations:
SKILL.md, lines 30-32SKILL.md, lines 40-42references/examples.md, lines 10-18references/examples.md, lines 36-39
Vulnerability Type: Bearer credential exposure through shell command history and process arguments
Risk Level: MediumVulnerable Code
SKILL.md, lines 30-32:bash curl -X POST https://motion-mcp-server.fly.dev/sessions \ -H "Content-Type: application/json" \ -d '{"agent_token": "{TOKEN}", "agent_name": "Claude"}'SKILL.md, lines 40-42:bash curl -X POST https://motion-mcp-server.fly.dev/sessions \ -H "Content-Type: application/json" \ -d '{"invite_token": "{INVITE_TOKEN}", "document_id": "{DOCUMENT_ID}", "agent_name": "Claude"}'references/examples.md, lines 10-18:bash curl -X POST $BASE/sessions \ -H "Content-Type: application/json" \ -d '{"agent_token": "YOUR_TOKEN", "agent_name": "Claude"}' # Or connect to a specific document immediately curl -X POST $BASE/sessions \ -H "Content-Type: application/json" \ -d '{"agent_token": "YOUR_TOKEN", "document_id": "DOC_ID", "agent_name": "Claude"}'references/examples.md, lines 36-39:bash # Create workspace-only session curl -X POST $BASE/sessions \ -H "Content-Type: application/json" \ -d '{"agent_token": "YOUR_TOKEN", "agent_name": "Claude"}'Technical Analysis
The documented workflows instruct users or agents to substitute authentication tokens directly into the JSON supplied through
curlcommand-line arguments. Once a real token replaces the placeholder, the bearer credential may be retained in interactive shell history. It may also be temporarily exposed through operating-system process inspection, terminal logging, command auditing, automation logs, or error-reporting systems that capture complete command lines.The impact is amplified for agent tokens because
SKILL.mdstates ...[truncated 2083 chars]- Remediation
View remediation
Remediation Suggestions
- Do not place bearer credentials directly in command-line arguments or literal example commands.
- Retrieve tokens from a protected credential manager or prompt for them without terminal echo.
- Construct the request body outside the visible command line and pass it to
curlthrough standard input or a permission-restricted temporary file. If a temporary file is used, create it with mode0600, avoid shared directories, and delete it immediately after use. - Prevent request bodies and authentication values from being emitted by shell tracing, verbose HTTP output, CI logs, or error diagnostics.
- Add explicit warnings that tokens must not be pasted into shell history, source files, chat transcripts, or build configuration.
- Prefer document-scoped invite credentials for single-document operations rather than workspace-wide agent tokens.
- Introduce short-lived, narrowly scoped tokens where supported and require explicit confirmation before workspace-wide enumeration or destructive operations.
- Document an immediate incident-response procedure: revoke an exposed token, terminate active sessions, issue a replacement, and review workspace activity for unauthorized access.
- Update every duplicated example consistently so users are not directed back to the unsafe pattern by secondary reference files.
