T03 · Remote Payload Retrieval and Execution
- Location
scripts/ensure-bws.sh:31- Finding
Unverified Remote Installer Download and Execution
- Content
View full analysis
Vulnerability Details
File Location:
scripts/ensure-bws.sh:31-32
Vulnerability Type: Remote code downloaded from a mutable URL and executed without local integrity verification
Risk Level: HighVulnerable Code
sh curl -fsSL https://bws.bitwarden.com/install -o "$installer" sh "$installer"The workflow in
SKILL.md:10-11directs the agent to run this installation helper at the beginning of every task. The corresponding Windows guidance also recommends direct remote execution:powershell iwr https://bws.bitwarden.com/install | iexTechnical Analysis
When
bwsis not present onPATH, the helper downloads an installer from a mutable remote URL and immediately executes it. HTTPS protects the connection in transit under normal conditions, but the script does not pin an installer version, verify a locally trusted checksum, or validate a digital signature before execution.The documentation states that the downloaded installer verifies the checksum of the eventual release archive. That verification does not establish the integrity of the installer itself: a compromised installer could alter or omit its own downstream checks.
Consequently, the effective code executed by the Skill can change after the repository has been reviewed. Compromise of the remote distribution endpoint, its publishing process, or a trusted certificate or delivery component could turn the mandatory setup step into arbitrary code execution.
Attack Path
- An attacker compromises the remote installer endpoint or its release and publishing infrastructure.
- The attacker replaces or modifies the script returned by
https://bws.bitwarden.com/install. - A user or agent invokes the Skill on a system where
bwsis not installed. - The Skill runs
scripts/ensure-bws.shas required by its startup instructions. - The helper downloads the attacker-controlled script to a temporary file.
- `sh "$install ...[truncated 758 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the installer to a reviewed, immutable version rather than using a mutable generic endpoint.
- Publish a trusted SHA-256 digest or signature with the Skill and verify it before execution.
- Prefer downloading a signed release binary directly and validating its signature and checksum locally.
- Fail closed if verification cannot be completed; never execute an unverified download.
- Replace the Windows
iwr ... | iexrecommendation with a download, verification, and execution sequence. - Do not make installation an automatic startup action. Ask for explicit user approval before downloading and executing external code.
- Prefer a trusted operating-system package manager where signed, version-pinned packages are available.
