T09 · Insecure Skill Coding Practices
- Location
references/cli-examples.md:15- Finding
Plaintext Secret Disclosure Through Disabled Output Masking
- Content
View full analysis
Vulnerability Details
File Location:
references/cli-examples.md, lines 15–17
Vulnerability Type: Plaintext sensitive-data exposure
Risk Level: HighVulnerable Code
markdown ## Run - `export DB_PASSWORD="op://app-prod/db/password"` - `op run --no-masking -- printenv DB_PASSWORD` - `op run --env-file="./.env" -- printenv DB_PASSWORD`Technical Analysis
The example resolves a 1Password secret into the
DB_PASSWORDenvironment variable and then executesprintenv DB_PASSWORD. The--no-maskingoption explicitly disables 1Password CLI output masking, causing the resolved database password to be emitted in plaintext.This practice conflicts with the guardrail in
SKILL.mdthat prohibits placing secrets in logs, chat, or code. Terminal output can be retained in tmux pane history, agent tool results, shell transcripts, CI/CD logs, session recordings, monitoring systems, or copied into conversational context. The adjacent--env-fileexample also prints the resolved value, although default masking may reduce exposure; secret-consuming commands should never be demonstrated using output utilities such asprintenv.Attack Path
- An operator or AI agent follows the documented
op runexample. - The authenticated 1Password CLI retrieves the secret referenced by
op://app-prod/db/password. op runplaces the resolved password in the child process environment asDB_PASSWORD.- The
--no-maskingoption disables 1Password's normal output redaction. printenv DB_PASSWORDwrites the plaintext password to standard output.- The output may be captured in tmux scrollback, agent tool output, logs, session recordings, or chat history.
- Anyone with access to those retained outputs can reuse the disclosed credential against the corresponding database until it is rotated or revoked.
Impact Assessment
Successful exploitation discloses the selected database credential to ...[truncated 458 chars]
- An operator or AI agent follows the documented
- Remediation
View remediation
Remediation Suggestions
-
Remove the
--no-masking -- printenv DB_PASSWORDexample and avoid all examples that print resolved secrets. -
Demonstrate
op runwith an application that consumes the credential without displaying it, for example:bash export DB_PASSWORD="op://app-prod/db/password" op run -- database-client --execute-safe-operation -
Retain 1Password's default output masking and explicitly prohibit
--no-maskingwhenever command output could contain secrets. -
Add a warning that
printenv,env, shell tracing (set -x), debug logging, and verbose application modes must not be used with resolved secret values. -
Ensure tmux pane captures and agent responses are reviewed to prevent secret-bearing output from entering logs or chat.
-
If the documented command has already been executed, remove accessible transcripts where feasible, rotate the affected database credential, and review database access logs for unauthorized use.
-
