T09 · Insecure Skill Coding Practices
- Location
references/cli-examples.md:17- Finding
Unmasked Secret Disclosure Through Standard Output
- Content
View full analysis
Vulnerability Details
File Location:
references/cli-examples.md, lines 17–18
Vulnerability Type: Plaintext sensitive-data exposure
Risk Level: HighVulnerable Code
bash export DB_PASSWORD="op://app-prod/db/password" op run --no-masking -- printenv DB_PASSWORDTechnical Analysis
The example passes a 1Password secret reference to
op run, explicitly disables 1Password's output masking with--no-masking, and then usesprintenvto write the resolved password to standard output.This behavior conflicts with the guardrail in
SKILL.mdthat prohibits exposing secrets in logs or chat. The prescribed workflow also usestmux 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
- The user or Agent authenticates to 1Password and gains access to the referenced vault item.
- The
DB_PASSWORDenvironment variable is assigned a 1Password secret reference. op runresolves that reference and supplies the plaintext value to its child process.- The
--no-maskingoption disables protection that would otherwise mask the secret in command output. printenv DB_PASSWORDemits the plaintext password to the terminal.- The output may be retained through tmux pane capture, Agent tooling, terminal logs, chat transcripts, or session observers.
- 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
View remediation
Remediation Suggestions
- Remove the
--no-masking -- printenv DB_PASSWORDexample. - Demonstrate
op runwith a command that consumes the injected variable without printing it. - Retain 1Password's default output masking and explicitly prohibit
--no-maskingfor sensitive values. - Do not capture or return terminal panes after commands that might emit secrets.
- If terminal capture is operationally necessary, inspect and redact the output before storing or returning it.
- Add guidance warning that secret-bearing environment variables can be exposed through child processes, debugging output, process inspection, or error reports.
- 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-passwordThe invoked application must also be configured not to log the password.
- Remove the
