Back to skill

Security audit

HashiCorp Vault

Security checks for vulnerabilities and agentic risk

Overview

This Vault helper is mostly coherent, but it can automatically use a local Vault token against a hard-coded plain-HTTP address unless the user overrides it.

Review this carefully before installing. Set VAULT_ADDR explicitly to the intended HTTPS Vault endpoint before using the scripts, avoid the hard-coded lab address for real credentials, verify any installed vault binary comes from HashiCorp, and treat get/list/put outputs and arguments as sensitive.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/vault-env.sh:4
Finding
Automatic Vault Token Transmission to a Hard-Coded Plaintext Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `scripts/vault-env.sh:4-10`; credential-consuming commands are invoked at `scripts/vault-get.sh:16`, `scripts/vault-list.sh:11`, and `scripts/vault-put.sh:16` **Vulnerability Type**: Plaintext credential exposure through insecure default configuration **Risk Level**: Critical ### Vulnerable Code ```bash : "${VAULT_ADDR:=http://192.168.1.101:8200}" export VAULT_ADDR token_file="${HOME}/.vault-token" if [[ -z "${VAULT_TOKEN:-}" && -f "$token_file" ]]; then VAULT_TOKEN="$(< "$token_file")" export VAULT_TOKEN fi ``` The token is subsequently used by these commands: ```bash vault kv get "$path" "$@" vault kv list "$path" "$@" vault kv put "$path" "$@" ``` ### Technical Analysis When `VAULT_ADDR` is not already set, the environment helper silently defaults it to `http://192.168.1.101:8200`. It then automatically reads the user's Vault token from `~/.vault-token` and exports it as `VAULT_TOKEN`. The Vault CLI uses this token to authenticate requests sent to the selected server. Because the default endpoint uses plaintext HTTP, authentication traffic lacks transport confidentiality and server authentication. A party controlling `192.168.1.101`, or one capable of intercepting or modifying traffic on the local network, can obtain the Vault token. The behavior is especially dangerous because the destination does not need to be explicitly approved before a locally stored credential is loaded and transmitted. ### Attack Path 1. A user invokes one of the supplied Vault helper scripts without explicitly defining `VAULT_ADDR`. 2. `vault-env.sh` assigns `http://192.168.1.101:8200` as the destination. 3. The script reads the user's existing token from `~/.vault-token` and exports it. 4. The invoked Vault CLI command sends an authenticated request to the plaintext HTTP endpoint. 5. An attacker controlling that host, or positioned to intercept local network traffic, captures the token. 6. The attacker reuses the t ...[truncated 875 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the hard-coded `VAULT_ADDR` default and fail closed when no endpoint is explicitly configured: ```bash if [[ -z "${VAULT_ADDR:-}" ]]; then echo "VAULT_ADDR must be explicitly configured" >&2 exit 2 fi ``` 2. Require HTTPS by default. Reject plaintext HTTP unless the user supplies a deliberate, narrowly scoped opt-in intended only for disposable local development environments. 3. Validate the destination before reading or exporting `VAULT_TOKEN`. Endpoint validation must occur before accessing `~/.vault-token`. 4. Use TLS certificate verification and a trusted CA. Do not disable certificate validation as a workaround. 5. Avoid automatically loading credentials for an unverified destination. Require explicit authentication or explicit confirmation when the configured endpoint changes. 6. Prefer short-lived, least-privileged tokens with narrowly scoped policies. Apply TTLs, periodic rotation, and CIDR restrictions where appropriate. 7. Revoke and rotate any token that may already have been transmitted through the plaintext default endpoint. 8. Update `SKILL.md` and the troubleshooting reference so plaintext HTTP addresses are clearly identified as unsafe lab-only examples rather than operational defaults. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:20
Finding
Ambiguous and Unpinned APT Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:20-26` **Vulnerability Type**: Unsafe dependency source and package identity configuration **Risk Level**: Medium ### Vulnerable Code ```yaml { "id": "apt", "kind": "apt", "package": "vault", "bins": ["vault"], "label": "Install HashiCorp Vault CLI (apt)", }, ``` ### Technical Analysis The APT installation entry requests the generic package name `vault` without specifying HashiCorp's authenticated repository, a verified package origin, or an expected version. APT resolves package names using the repositories configured on the user's system. Consequently, the package selected under the name `vault` may be unrelated to the intended HashiCorp Vault CLI or may originate from an untrusted or compromised repository. No version pinning or package provenance check is defined to reduce that risk. Package installation is a privileged supply-chain boundary because Debian packages can contain maintainer scripts that execute during installation. ### Attack Path 1. A user or automation system chooses the documented APT installation method. 2. APT searches the repositories configured on the host for a package named `vault`. 3. An unintended, substituted, or malicious package is preferred because the expected HashiCorp repository and package origin were not specified. 4. The package is downloaded and installed. 5. Package maintainer scripts execute during installation, or the substituted `vault` binary executes when the skill later invokes it. 6. Attacker-controlled code gains the permissions of the installation process or the user running the resulting binary. ### Impact Assessment The impact depends on how installation is performed and what package is selected: - If installation runs through `sudo` or another privileged package-management workflow, malicious maintainer scripts may execute with root privileges. - A substituted `vault` binary may capture `VAULT_TOKEN`, secret values, command ar ...[truncated 355 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Configure and document HashiCorp's official authenticated APT repository rather than relying on an ambiguous package name in arbitrary configured repositories. 2. Verify the repository signing key through an authenticated HashiCorp channel and use modern per-repository keyring configuration with `signed-by`. 3. Pin the package origin and an approved version or constrained version range. 4. Validate the installed package provenance and binary: ```bash apt-cache policy vault vault version ``` 5. Avoid unverified mirrors and repositories with overlapping package names. 6. Document expected publisher, repository URL, package name, version, and verification procedure in `SKILL.md`. 7. Where supported by the skill packaging system, replace the generic APT declaration with an installation mechanism that explicitly identifies the trusted vendor repository and verifies downloaded artifacts. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Vague Triggers

Medium
Confidence
93% confidence
Finding
The skill description contains very broad trigger phrases such as 'Use when tasks mention HashiCorp Vault' and references to common terms like secret paths, environment variables, policies, mounts, and the vault command. This can cause over-activation on routine Vault-related discussion and may steer an agent into using a powerful secrets-management skill in contexts where narrower intent detection would be safer, increasing the chance of unnecessary secret access or operational changes.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The script reads a sensitive credential from ${HOME}/.vault-token and exports it as VAULT_TOKEN, but there is no comment, log message, or other user-facing disclosure explaining that credential material will be loaded into the environment. For code files, access to sensitive environment variables or credentials should include some form of visible warning or documentation unless already clearly disclosed elsewhere.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The script executes `vault kv get` to retrieve secrets from Vault, which is a sensitive operation involving access to confidential data. While the script shows usage information when arguments are missing, it does not provide any confirmation, warning, or user-facing notice that it is accessing secret material.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
This shell script writes secrets to Vault via `vault kv put`, which is a safety-relevant operation affecting stored credentials or sensitive data. The file provides only a usage message and contains no confirmation prompt, user-facing disclosure, or explanatory comment warning that it will persist provided key/value pairs to the target Vault path.

Static analysis

No suspicious patterns detected.