Back to skill

Security audit

MH 1password

Security checks for vulnerabilities and agentic risk

Overview

This skill is for 1Password CLI use, but its examples can expose real passwords or keys in terminal output and local files, so it needs review before installation.

Install only if you are comfortable with an agent helping operate your 1Password CLI. Do not run the examples that print secrets, disable masking, capture terminal panes after secret output, or write keys/configs to disk unless you have isolated the environment and planned permissions and cleanup.

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

Warning
Location
references/cli-examples.md:10
Finding
Secret Disclosure Through Plaintext CLI Output and Insecure File Export Examples<![CDATA[ ## Vulnerability Details **File Location**: `references/cli-examples.md:10-24`; related pane-capture workflow in `SKILL.md:42-57` **Vulnerability Type**: Plaintext sensitive-data exposure **Risk Level**: Medium ### Vulnerable Code ```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` ## Inject - `echo "db_password: {{ op://app-prod/db/password }}" | op inject` - `op inject -i config.yml.tpl -o config.yml` ``` The related workflow captures terminal contents: ```bash tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200 ``` ### Technical Analysis The examples instruct users or agents to retrieve passwords, one-time passwords, private keys, and rendered configuration directly into terminal output. The `--no-masking` option explicitly disables 1Password's output masking before `printenv` prints the resolved database password. This is especially unsafe in the context of the mandatory tmux workflow. A secret-producing command can place plaintext credentials in the tmux scrollback buffer, after which `capture-pane` can copy that content into tool output, an agent transcript, logs, or chat context. The file-output examples create `key.pem` and `config.yml` without requiring a private directory, a restrictive `umask`, explicit file permissions, or secure cleanup. Consequently, sensitive files may inherit permissions that are broader than intended. These examples conflict with the guardrails in `SKILL.md`, which state that secrets must not be pasted into logs, chat, or code and that `op run` or `op inject` should be preferred over writing secrets to disk. ### Attack Path 1. A user or age ...[truncated 1610 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `--no-masking` option and all examples that print resolved secrets through `printenv`, `echo`, or direct `op read` output. 2. Demonstrate `op run` with a consumer process that uses the secret without displaying it, and explicitly warn against debug output that exposes environment variables. 3. Do not execute `tmux capture-pane` after any command that may emit secret material. Capture only authentication status or non-sensitive metadata, and clear tmux history before terminating the session. 4. Replace secret-bearing examples with non-executing placeholders or commands that verify success without returning secret values. 5. Prefer in-memory secret delivery through `op run` over file creation. 6. If disk output is unavoidable: - Create a private directory owned by the current user. - Set `umask 077` before creating files. - Require permissions such as `chmod 600`. - Avoid predictable shared paths. - Delete the file securely as soon as it is no longer needed. 7. Add an explicit warning that OTPs, private keys, passwords, rendered templates, and secret-bearing environment variables must never be included in terminal captures, logs, transcripts, or chat output. ]]>
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 (6)

Env Variable Harvesting

High
Category
Data Exfiltration
Content
## 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
Confidence
98% confidence
Finding
`op run --no-masking -- printenv DB_PASSWORD` resolves the secret into an environment variable and then prints it, which is a direct credential disclosure pattern. This is especially dangerous in shells, CI systems, and shared terminals where stdout may be logged or observed by other users or processes.

Missing User Warnings

High
Confidence
99% confidence
Finding
The example explicitly disables masking with `--no-masking` and prints the secret via `printenv`, causing the secret value to be exposed in terminal output, logs, recordings, or CI job traces. Because this skill is specifically about handling secrets with 1Password, demonstrating unmasked output materially increases the chance users will leak credentials.

Env Variable Harvesting

High
Category
Data Exfiltration
Content
- `export DB_PASSWORD="op://app-prod/db/password"`
- `op run --no-masking -- printenv DB_PASSWORD`
- `op run --env-file="./.env" -- printenv DB_PASSWORD`

## Inject
Confidence
90% confidence
Finding
Using `op run --env-file="./.env" -- printenv DB_PASSWORD` still demonstrates printing a secret-bearing environment variable, exposing the resolved secret to stdout. Although it does not disable masking explicitly, the example normalizes a workflow where secrets are surfaced in command output rather than consumed safely by an application.

Credential Access

High
Category
Privilege Escalation
Content
- `export DB_PASSWORD="op://app-prod/db/password"`
- `op run --no-masking -- printenv DB_PASSWORD`
- `op run --env-file="./.env" -- printenv DB_PASSWORD`

## Inject
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The examples include commands that write secret material to local files and inject secrets into files or stdout without any warning about secure handling. In a secrets-management skill, this can lead users to leave plaintext secrets on disk, in shell history, backups, or world-readable locations, increasing accidental exposure risk.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Content
- 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`.
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.

Static analysis

No suspicious patterns detected.