T09 · Insecure Skill Coding Practices
Error
- Location
- references/cli-examples.md:17
- Finding
- Unmasked Secret Disclosure Through Standard Output## Vulnerability Details **File Location**: `references/cli-examples.md`, lines 17–18 **Vulnerability Type**: Plaintext sensitive-data exposure **Risk Level**: High ### Vulnerable Code ```bash export DB_PASSWORD="op://app-prod/db/password" op run --no-masking -- printenv DB_PASSWORD ``` ### Technical Analysis The example passes a 1Password secret reference to `op run`, explicitly disables 1Password's output masking with `--no-masking`, and then uses `printenv` to write the resolved password to standard output. This behavior conflicts with the guardrail in `SKILL.md` that prohibits exposing secrets in logs or chat. The prescribed workflow also uses `tmux capture-pane`, so terminal output generated by this example could subsequently be copied into tool output, execution logs, chat context, or other retained records. The vulnerability does not independently bypass 1Password authorization. It exposes secrets that the authenticated user or Agent is already authorized to retrieve. ### Attack Path 1. The user or Agent authenticates to 1Password and gains access to the referenced vault item. 2. The `DB_PASSWORD` environment variable is assigned a 1Password secret reference. 3. `op run` resolves that reference and supplies the plaintext value to its child process. 4. The `--no-masking` option disables protection that would otherwise mask the secret in command output. 5. `printenv DB_PASSWORD` emits the plaintext password to the terminal. 6. The output may be retained through tmux pane capture, Agent tooling, terminal logs, chat transcripts, or session observers. 7. A party with access to any retained output can reuse the disclosed credential against systems where it remains valid. ### Impact Assessment Successful exploitation discloses a 1Password-managed credential available to the authenticated account. The resulting access is limited by the privileges of the exposed credential, but it could include database access ...[truncated 372 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the `--no-masking -- printenv DB_PASSWORD` example. 2. Demonstrate `op run` with a command that consumes the injected variable without printing it. 3. Retain 1Password's default output masking and explicitly prohibit `--no-masking` for sensitive values. 4. Do not capture or return terminal panes after commands that might emit secrets. 5. If terminal capture is operationally necessary, inspect and redact the output before storing or returning it. 6. Add guidance warning that secret-bearing environment variables can be exposed through child processes, debugging output, process inspection, or error reports. 7. If this example has already been executed in a recorded environment, remove affected logs and transcripts and rotate the disclosed credential. A safer conceptual example is: ```bash export DB_PASSWORD="op://app-prod/db/password" op run -- application-that-consumes-db-password ``` The invoked application must also be configured not to log the password.
