T03 · Remote Payload Retrieval and Execution
- Location
getphi.sh:1- Finding
Unverified Remote Binary Download and Subsequent Execution
- Content
View full analysis
Vulnerability Details
File Location:
getphi.sh, lines 1-3
Vulnerability Type: Unverified retrieval of executable code from an external source
Risk Level: Highbash #!/usr/bin/env bash mkdir -p "$HOME/.local/bin" wget -O "$HOME/.local/bin/phicli" "https://github.com/chengongpp/phiproto/releases/download/0.0.2/phicli"Technical Analysis
The installation script downloads a precompiled executable directly from a third-party GitHub release into
$HOME/.local/bin/phicli. It does not verify a cryptographic checksum, release signature, signer identity, or other integrity metadata before the binary is used.Pinning the URL to release
0.0.2limits ordinary version drift but does not establish artifact integrity. The effective executable could change if the upstream repository, release artifact, maintainer account, or distribution infrastructure were compromised. This allows code not present during the skill audit to become the effective runtime payload.The target path may also contain an existing
phiclicommand. The use ofwget -Oreplaces its contents without warning, potentially causing future legitimate-lookingphiclicalls to execute the newly downloaded payload.SKILL.mddirects users or agents to invokephiclifor decoding and encoding, completing the path from remote retrieval to execution.Attack Path
- An attacker compromises the upstream repository, release artifact, maintainer account, or another relevant distribution component.
- The attacker replaces the
0.0.2binary with a malicious executable while retaining the expected URL. - A user or agent runs
getphi.sh. - The script downloads the artifact without validating its checksum or signature and writes it to
$HOME/.local/bin/phicli. - The user or agent subsequently invokes
phicliaccording to the documented decode or encode workflow. - The malicious binary executes with the permissions and environment of th ...[truncated 757 chars]
- Remediation
View remediation
Remediation Suggestions
- Publish a trusted SHA-256 or stronger digest for the exact release artifact and hard-code the expected digest in the installer.
- Download the artifact to a securely created temporary file and verify its digest before moving it into the destination directory.
- Prefer signed releases and verify the signature against a pinned, independently distributed maintainer public key.
- Use strict shell settings such as
set -euo pipefailand explicitly handle download and verification failures. - Install atomically only after successful verification.
- Refuse to overwrite an existing
$HOME/.local/bin/phicliunless the user explicitly approves the replacement. - Pin not only the version but also the immutable expected artifact identity.
- Where practical, build the utility from reviewed source using a reproducible build process rather than trusting an opaque precompiled binary.
- Update
SKILL.mdto state that the binary is downloaded rather than bundled and to document the verification procedure and expected checksum.
