T09 · Insecure Skill Coding Practices
Warning
- Location
- Skill.md:23
- Finding
- Credentials Are Exposed Through Chat and Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `Skill.md:23-32` **Additional Locations**: `Skill.md:193`, `Skill.md:356-364` **Vulnerability Type**: Sensitive credential exposure through chat, process arguments, shell history, and plaintext configuration **Risk Level**: Medium ### Vulnerable Code ```markdown ## Step 2: Get API Key (ask the user) An API key is required for meaningful usage (1,100 credits vs 100 anonymous). API keys are bound to a human account — **you cannot create one yourself**. Ask the user: > I need a Prismer Cloud API key to use context/parse/IM services. Please visit https://prismer.cloud, sign up (GitHub/Google one-click), then go to **Dashboard → API Keys → Create** and share the key with me. It looks like `sk-prismer-...`. If the user provides a key, bind it: ```bash prismer init <the-api-key-from-user> ``` ``` The same unsafe command-line pattern is used for a Telegram bot token: ```bash prismer im bindings create telegram --bot-token xxx --chat-id yyy ``` The Skill also documents persistent plaintext credential storage: ```toml [default] api_key = "sk-prismer-xxx" # optional, for bound registration [auth] im_token = "eyJ..." # IM JWT im_user_id = "pxoi9cas5rz" # IM User ID im_username = "my-agent" # Username ``` ### Technical Analysis The Skill explicitly asks the user to share a Prismer Cloud API key with the Agent. This places the secret in the conversation context and potentially in conversation history, execution traces, observability systems, debugging logs, or third-party model-provider records. It then directs the Agent to insert the key into a command-line argument. Command-line secrets can be exposed through: - Shell history files. - Process inspection utilities and `/proc` interfaces. - Agent tool-call and command-execution logs. - Terminal session recording. - Error reports or debugging telemetry. The Telegram binding command has the same issue because `--bot-tok ...[truncated 2212 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not ask users to paste API keys, JWTs, webhook secrets, or bot tokens into chat. 2. Accept secrets through a protected interactive prompt that disables terminal echo, standard input, an OS credential manager, or a documented environment variable. 3. Avoid placing secrets in command-line arguments. For example, support an interactive `prismer init` flow or a `--token-stdin` option. 4. Ensure the CLI redacts credentials from command output, exceptions, telemetry, and debug logs. 5. Store persistent credentials in the operating system's credential store where possible. 6. If file-based storage is unavoidable, create `~/.prismer/config.toml` with owner-only permissions such as mode `0600`, reject insecure ownership or permissions, and avoid storing unnecessary long-lived tokens. 7. Use short-lived, narrowly scoped tokens instead of account-wide reusable credentials. 8. Document credential rotation, expiration, and revocation procedures. 9. Require explicit user approval before transmitting files, messages, or other sensitive content to Prismer Cloud. 10. Provide equivalent secure handling for Telegram bot tokens and webhook secrets. ]]>
