T09 · Insecure Skill Coding Practices
- Location
references/cli-examples.md:8- Finding
Secrets May Be Exposed Through Unmasked Terminal Output and tmux Pane Capture
- Content
View full analysis
Vulnerability Details
File Location:
references/cli-examples.md:8-22; related capture behavior inSKILL.md:55
Vulnerability Type: Plaintext sensitive-data exposure
Risk Level: MediumVulnerable Code
bash - `op read op://app-prod/db/password` - `op read "op://app-prod/db/one-time password?attribute=otp"` - `op read "op://app-prod/ssh key/private key?ssh-format=openssh"` - `op read --out-file ./key.pem op://app-prod/server/ssh/key.pem` ## Run - `export DB_PASSWORD="op://app-prod/db/password"` - `op run --no-masking -- printenv DB_PASSWORD` - `op run --env-file="./.env" -- printenv DB_PASSWORD` ## Inject - `echo "db_password: {{ op://app-prod/db/password }}" | op inject`The required tmux workflow additionally contains this command at
SKILL.md:55:bash tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200Technical Analysis
Several documented examples resolve secrets and print their plaintext values directly to standard output. The
op run --no-maskingexample explicitly disables 1Password's output masking before executingprintenv, guaranteeing that the resolved database password is displayed. Theop readcommands similarly emit passwords, one-time passwords, and private-key material to the terminal. Pipingop injectoutput to the terminal can expose the fully rendered configuration and its embedded secrets.This behavior becomes more hazardous because
SKILL.mdrequiresopcommands to run in tmux and demonstrates capturing the last 200 lines of pane output. If a secret-producing example is followed bycapture-pane, the plaintext secret can be copied into tool responses, agent context, conversation history, terminal logs, or other retained execution records.The private-key and injected-file examples can also persist sensitive information on disk without documenting restrictive permissions or cleanup. This contradicts the guardrail in `SKILL ...[truncated 1860 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove examples that display resolved secrets, including direct
op readoutput,printenv, and terminal-directedop inject. - Remove
--no-masking; do not disable 1Password's output protections in documentation or automated workflows. - Demonstrate
op runonly with programs that consume secrets without printing them, for example:bash op run --env-file="./.env" -- application-command - Prohibit
tmux capture-paneafter any command that could emit a secret. If pane capture is needed for diagnostics, perform it before secret access or capture only known non-sensitive commands. - Avoid writing private keys and rendered secret-bearing configuration to disk. Prefer direct in-memory consumption through
op runor controlled standard-input pipelines. - Where file output is unavoidable, create it in a protected directory with mode
0600, avoid shared temporary paths, verify ownership, and delete it promptly after use. - Add an explicit rule that agents must never return resolved secret values in tool output, chat, logs, command traces, or error reports.
- Add safe validation examples that verify only success or failure without revealing values, and redact any accidental output before it enters retained logs.
- Remove examples that display resolved secrets, including direct
