T09 · Insecure Skill Coding Practices
- Location
SKILL.md:40- Finding
Plaintext Secret Exposure Through Terminal Output, Tmux Capture, and Files
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:40-45;references/cli-examples.md:10-13,17-19,23-24
Vulnerability Type: Plaintext credential disclosure caused by unsafe secret-handling examples
Risk Level: HighVulnerable Code
SKILL.md:40-45:bash tmux -S "$SOCKET" new -d -s "$SESSION" -n shell tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op signin --account my.1password.com" Enter tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op whoami" Enter tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- "op vault list" Enter tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200 tmux -S "$SOCKET" kill-session -t "$SESSION"references/cli-examples.md:10-13: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`references/cli-examples.md:17-19:bash - `export DB_PASSWORD="op://app-prod/db/password"` - `op run --no-masking -- printenv DB_PASSWORD` - `op run --env-file="./.env" -- printenv DB_PASSWORD`references/cli-examples.md:23-24:bash - `echo "db_password: {{ op://app-prod/db/password }}" | op inject` - `op inject -i config.yml.tpl -o config.yml`Technical Analysis
Several documented examples resolve sensitive 1Password references directly to standard output or plaintext files. In particular,
op run --no-masking -- printenv DB_PASSWORDexplicitly disables 1Password's output masking and prints the resolved database password. Theop readand pipedop injectexamples can likewise place passwords, one-time passwords, or private keys in terminal output.The required workflow subsequently demonstrates
tmux capture-pane, which copies terminal scrollback to the caller's output. If a secret-producing command is run in the same pane, its ...[truncated 2150 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
--no-maskingand all examples that pass resolved secrets toprintenv,echo, or other standard-output commands. - Demonstrate
op runonly by launching the intended application directly, without displaying its secret-bearing environment:bash op run --env-file="./.env" -- ./application - Do not run
tmux capture-paneafter any command that may display a secret. Use a separate pane for authentication and status checks, clear scrollback before capture, or avoid pane capture entirely. - Replace direct
op readexamples with examples that consume the secret without printing it. Where output is inherently required, add an explicit warning that the command must not be executed through captured or logged terminals. - Avoid writing private keys or injected configurations to disk. Prefer process substitution, standard input, or an application interface that consumes the secret in memory.
- When a file is unavoidable, create it in a protected directory with restrictive permissions, for example by setting
umask 077, and securely delete it immediately after use. - Add automated redaction or output filtering as defense in depth, while making clear that redaction is not a substitute for avoiding plaintext output.
- Update the workflow so its examples are consistent with the existing prohibition against placing secrets in logs, chat, or code.
- Remove
