Back to skill

Security audit

Securely interact with Bitwarden/Vaultwarden vaults using rbw CLI. Use when retrieving credentials, managing vault items, or integrating secrets into scripts/systemd services. Handles authentication, field access, and non-interactive operation patterns.

Security checks for vulnerabilities and agentic risk

Overview

The skill is a straightforward rbw guide, but its automation instructions persist and expose a Bitwarden/Vaultwarden master password in ways users should review carefully.

Install only if you are comfortable with the security tradeoff in the non-interactive examples. Prefer interactive unlock, systemd LoadCredential/LoadCredentialEncrypted, or another secret manager over storing a vault master password in plaintext, and avoid putting the master password directly in shell commands or inherited environments.

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
SKILL.md:99
Finding

Plaintext Vault Master Password Storage and Environment Exposure

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 99-157
Vulnerability Type: Plaintext sensitive-data storage and insecure environment-variable propagation
Risk Level: High

The documented non-interactive authentication pattern stores the Bitwarden/Vaultwarden master password in a plaintext configuration file and imports it into the systemd service environment. The pinentry wrapper then reads the password from that environment.

bash
#!/usr/bin/env bash
if [ -n "$RBW_MASTER_PASSWORD" ]; then
    echo "OK Pleased to meet you"
    while IFS= read -r line; do
        case "$line" in
            GETPIN)
                echo "D $RBW_MASTER_PASSWORD"
                echo "OK"
                ;;
            BYE)
                echo "OK closing connection"
                exit 0
                ;;
            *)
                echo "OK"
                ;;
        esac
    done
else
    exec /usr/bin/pinentry-curses "$@"
fi
bash
chmod +x ~/.local/bin/pinentry-rbw-systemd
rbw config set pinentry ~/.local/bin/pinentry-rbw-systemd
rbw config show   # verify
text
RBW_MASTER_PASSWORD=your_master_password_here
ini
[Service]
User=tripleight
EnvironmentFile=/etc/systemd/rbw-credentials.conf
ExecStart=/path/to/script.sh
bash
#!/usr/bin/env bash
set -euo pipefail

if ! rbw unlocked 2>/dev/null; then
    rbw unlock || { echo "ERROR: Failed to unlock rbw" >&2; exit 1; }
fi

rbw sync

USERNAME=$(rbw get --folder homelab service_name --field Username 2>/dev/null \
  || { echo "ERROR: Cannot read username (homelab/service_name)" >&2; exit 1; })
PASSWORD=$(rbw get --folder homelab service_name 2>/dev/null \
  || { echo "ERROR: Cannot read password (homelab/service_name)" >&2; exit 1; })

curl -u "$USERNAME:$PASSWORD" https://api.example.com

Technical Analysis

File permissions of 600 and `root:root ...[truncated 2319 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the plaintext EnvironmentFile= pattern with systemd's LoadCredential= or LoadCredentialEncrypted= facility.
  2. Read the credential directly from the systemd credential file only inside the pinentry helper rather than exporting it into the service-wide environment.
  3. Scope the credential to the shortest possible lifetime and remove it immediately after unlocking the vault.
  4. Ensure unrelated child processes, including API clients such as curl, do not inherit the master password.
  5. Prefer interactive or hardware-backed unlocking for high-security environments.
  6. Apply restrictive ownership and permissions to both the credential and pinentry helper, and prevent untrusted users from modifying the helper configured through rbw config set pinentry.
  7. Exclude credential material from backups, logs, shell history, diagnostics, and crash reports unless those systems provide suitable encryption and access controls.
  8. If plaintext storage was previously deployed, rotate the vault master password and review vault and account activity for unauthorized access.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Session Persistence

Medium
Category
Rogue Agent
Confidence
97% confidence
Finding

The skill provides a non-interactive pattern that stores the Bitwarden/Vaultwarden master password in a plaintext file and feeds it through an environment-variable-based pinentry wrapper. This creates persistent exposure of the vault's root secret to local compromise, accidental disclosure, backups, misconfiguration, and potentially other processes or administrators, undermining the security boundary of the entire vault.

Content

Scanner excerpt · SKILL.md (reported line 108)May include surrounding context.

Security note: This pattern stores your master password in a plaintext file. Even with 600 permissions and root:root ownership, this is a security tradeoff. For higher-security environments, consider systemd's native LoadCredential= mechanism instead.

1. Create a pinentry wrapper (~/.local/bin/pinentry-rbw-systemd):

bash
#!/usr/bin/env bash

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 142)May include surrounding context.

rbw config show # verify

text

**3. Store master password** (`/etc/systemd/rbw-credentials.conf`, `root:root`, `chmod 600`):

RBW_MASTER_PASSWORD=your_master_password_here

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file includes a script pattern that reads a username and password from the vault and sends them via curl -u to a remote endpoint. While the file warns about plaintext password storage for systemd, it does not similarly warn that these examples transmit retrieved secrets over the network, which is a behavior that could affect user data and privacy.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 226)May include surrounding context.

md
**Systemd service fails to unlock:**
1. Verify `/etc/systemd/rbw-credentials.conf` exists with the correct password
2. Check permissions: `sudo ls -l /etc/systemd/rbw-credentials.conf` (expect `root:root 600`)
3. Verify pinentry config: `rbw config show`
4. Test manually: `sudo -u tripleight bash -c 'export RBW_MASTER_PASSWORD=...; rbw unlock'`

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
83% confidence
Finding

The troubleshooting step demonstrates exporting the master password directly on the command line under sudo, which can expose the secret via shell history, process inspection, audit logs, or operational copy/paste mistakes. Although intended for manual testing, it normalizes an unsafe secret-handling pattern for the vault's most sensitive credential.

Content

Scanner excerpt · SKILL.md (reported line 228)May include surrounding context.

md
1. Verify `/etc/systemd/rbw-credentials.conf` exists with the correct password
2. Check permissions: `sudo ls -l /etc/systemd/rbw-credentials.conf` (expect `root:root 600`)
3. Verify pinentry config: `rbw config show`
4. Test manually: `sudo -u tripleight bash -c 'export RBW_MASTER_PASSWORD=...; rbw unlock'`

**Item not found** — check folder and item names with `rbw list --fields "name,folder"`, then `rbw sync`.

Static analysis

No suspicious patterns detected.