T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:18
- Finding
- Unverified Remote Bitwarden CLI Download and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 18 **Vulnerability Type**: Unverified remote payload retrieval and installation **Risk Level**: High ### Vulnerable Code ```sh PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]'); [ "$PLATFORM" = 'darwin' ] && PLATFORM='macos'; curl -sL "https://vault.bitwarden.com/download/?app=cli&platform=${PLATFORM}" -o /tmp/bw.zip && unzip -o /tmp/bw.zip -d ~/.local/bin/ && chmod +x ~/.local/bin/bw && rm /tmp/bw.zip ``` ### Technical Analysis The installation command downloads a mutable Bitwarden CLI archive from an external URL, extracts it directly into `~/.local/bin`, and marks the resulting `bw` file executable. It does not pin a specific release or verify an official checksum or cryptographic signature before installation. Although the archive is retrieved over HTTPS from the official Bitwarden domain, `curl -L` follows redirects and the downloaded content remains dependent on external infrastructure at installation time. Consequently, the effective executable can differ from the content available when the skill was reviewed. The command also uses the predictable shared path `/tmp/bw.zip` and invokes `unzip -o`, which overwrites files without prompting. These practices create additional opportunities for local temporary-file interference and unsafe archive extraction. ### Attack Path 1. A user or agent invokes the skill's built-in Bitwarden CLI installer. 2. The installer requests a mutable external download URL and follows redirects. 3. An attacker compromises the distribution or redirect path, or interferes with the predictable temporary archive path under applicable local conditions. 4. A modified archive is stored as `/tmp/bw.zip`. 5. Because no checksum or signature is verified, the archive is accepted automatically. 6. `unzip -o` writes the attacker-controlled `bw` executable into `~/.local/bin`. 7. The file is granted executable permissions and is subsequently invoked by the documented ...[truncated 913 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the Bitwarden CLI to an explicitly approved version and use a version-specific official download URL. 2. Obtain the expected SHA-256 digest through a trusted, independently authenticated release channel. 3. Verify the archive before extraction and abort installation if verification fails. 4. If Bitwarden publishes cryptographic signatures, validate the signature against a pinned and trusted signing key. 5. Use strict download options such as: ```sh curl --fail --show-error --location ``` 6. Replace the predictable `/tmp/bw.zip` path with a private temporary directory: ```sh tmpdir="$(mktemp -d)" trap 'rm -rf "$tmpdir"' EXIT ``` 7. Inspect and validate archive entries before extraction, rejecting absolute paths, traversal sequences, symbolic-link surprises, and unexpected files. 8. Extract into the private temporary directory first, verify the resulting executable, and then install it atomically into `~/.local/bin`. 9. Avoid unconditional overwrite behavior such as `unzip -o` unless the destination and archive contents have both been validated. 10. Prefer directing users to the platform's official package manager or Bitwarden's documented installation procedure where practical. ]]>
