Back to skill

Security audit

1password

Security checks for vulnerabilities and agentic risk

Overview

This 1Password CLI skill is purpose-aligned, but its examples can cause real secrets to be printed or captured in agent logs.

Review before installing. This skill is for a real password manager account, so only use it in sessions where you are comfortable authorizing vault access. Avoid copying the examples that print secrets, use --no-masking, read private keys to stdout, or write secrets into repo files; prefer passing secrets directly to the intended command and keep pane captures away from any secret-producing command output.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
references/cli-examples.md:8
Finding

Secret Disclosure Through Unmasked CLI Output and tmux Pane Capture

Content
View full analysis

Vulnerability Details

File Location: references/cli-examples.md:8-19; SKILL.md:29-47
Vulnerability Type: Sensitive information exposure through terminal output and session capture
Risk Level: High

Vulnerable Code

references/cli-examples.md:8-19:

bash
## Read

- `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`

SKILL.md:29-47:

bash
## REQUIRED tmux session (T-Max)

The shell tool uses a fresh TTY per command. To avoid re-prompts and failures, always run `op` inside a dedicated tmux session with a fresh socket/session name.

Example (see `tmux` skill for socket conventions, do not reuse old session names):

```bash
SOCKET_DIR="${CLAWDBOT_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/clawdbot-tmux-sockets}"
mkdir -p "$SOCKET_DIR"
SOCKET="$SOCKET_DIR/clawdbot-op.sock"
SESSION="op-auth-$(date +%Y%m%d-%H%M%S)"

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"
text

### Technical Analysis

The documented `op read` commands emit sensitive values directly to standard output, including passwords, one-time passwords, and SSH private keys. The `op run --no-masking -- printenv DB_PASSWORD` example explicitly disables 1Password's output masking and then prints the resolved password.

The main workflow
...[truncated 2584 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove examples that print secrets directly, particularly:
    • op read without a protected destination or consumer
    • op run --no-masking
    • printenv or similar commands used to display resolved credentials
  2. Preserve 1Password's output masking and prohibit --no-masking in agent-driven workflows.
  3. Prefer passing secrets directly to their intended process with op run without printing the corresponding environment variables.
  4. Do not invoke tmux capture-pane after any command that may emit a secret. Separate authentication and non-sensitive verification from secret-consuming operations.
  5. If pane capture is necessary for diagnostics, capture only known non-sensitive commands and apply strict redaction before returning output to an agent, chat, or log.
  6. Disable or tightly limit tmux history for secret-bearing sessions, and destroy the session immediately after use.
  7. When a secret must be written to disk:
    • Set a restrictive umask, such as 077, before file creation.
    • Use an explicitly protected destination outside the repository.
    • Verify permissions are limited to the current user.
    • Exclude generated files from version control and backups where appropriate.
    • Securely remove temporary material as soon as the consuming operation finishes.
  8. Add an explicit workflow rule stating that agents must never return resolved secret values in tool output or conversation text.
  9. Add automated checks or policy enforcement to reject commands containing dangerous combinations such as --no-masking, printenv of secret variables, or pane capture following op read.
  10. Rotate any credential that may already have appeared in captured pane output, agent transcripts, or execution logs.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
95% confidence
Finding

The example explicitly demonstrates resolving a secret into an environment variable and then printing it with printenv, while also using --no-masking. This exposes the secret to stdout, shell history/logging pipelines, CI logs, or any caller capturing command output, making credential disclosure very likely if copied into real use.

Content

Scanner excerpt · references/cli-examples.md (reported line 18)May include surrounding context.

md
## 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

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
89% confidence
Finding

This example shows op run --env-file="./.env" -- printenv DB_PASSWORD, which encourages loading secrets into process environment and then echoing them to output. Even without --no-masking, printing secrets can leak them to terminal logs, CI output, monitoring systems, or other observers, constituting direct credential exposure.

Content

Scanner excerpt · references/cli-examples.md (reported line 19)May include surrounding context.

md
- `export DB_PASSWORD="op://app-prod/db/password"`
- `op run --no-masking -- printenv DB_PASSWORD`
- `op run --env-file="./.env" -- printenv DB_PASSWORD`

## Inject

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/cli-examples.md (reported line 19)May include surrounding context.

md
- `export DB_PASSWORD="op://app-prod/db/password"`
- `op run --no-masking -- printenv DB_PASSWORD`
- `op run --env-file="./.env" -- printenv DB_PASSWORD`

## Inject

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

Scanner excerpt · references/get-started.md (reported line 15)May include surrounding context.

md
- macOS: Settings > Developer > Integrate with 1Password CLI (Touch ID optional).
  - Windows: turn on Windows Hello, then Settings > Developer > Integrate.
  - Linux: Settings > Security > Unlock using system authentication, then Settings > Developer > Integrate.
- After integration, run any command to sign in (example in docs: `op vault list`).
- If multiple accounts: use `op signin` to pick one, or `--account` / `OP_ACCOUNT`.
- For non-integration auth, use `op account add`.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/cli-examples.md:17