T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/install.sh:48
- Finding
- Mutable Remote Code Installation Through Unpinned Latest Release<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install.sh:48-50` **Vulnerability Type**: Mutable remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash # Default to @latest when no version specified. VERSION="${VERSION:-@latest}" echo "=== Installing lnget ===" ``` The value is subsequently used at `scripts/install.sh:61`: ```bash go install "github.com/lightninglabs/lnget/cmd/lnget${VERSION}" ``` ### Technical Analysis When no version is specified, the installer resolves `github.com/lightninglabs/lnget/cmd/lnget@latest` at installation time. This downloads source code and dependencies from external infrastructure, compiles them, and installs the resulting executable under the invoking user's account. Because `@latest` is mutable, the installed code can differ from the code that existed when this Skill was audited. The installation documentation also recommends an unpinned `git clone` as an alternative. The referenced repository is consistent with the Skill's declared functionality, and there is no evidence in the audited files that it is currently malicious. Nevertheless, the installation mechanism creates a remote code execution channel whose effective payload can change after review. The optional `--version` argument allows callers to select a version, but secure pinning is not the default, and the script performs no checksum or signature verification. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, release process, Go module distribution path, or a transitive dependency. 2. The attacker publishes a malicious version that is selected by the `@latest` query. 3. A user invokes `scripts/install.sh` without an explicit reviewed version. 4. `go install` downloads and compiles the changed remote source and its dependency graph. 5. The malicious binary is installed with the user's permissions. 6. When the user or agent runs `lnget`, the payload can access files and ...[truncated 720 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace `@latest` with a specific, reviewed, immutable release version. 2. Require an explicit version rather than silently defaulting to the latest release. 3. Verify the selected release using a trusted checksum, signed tag, or provenance record before installation. 4. Pin and review the relevant Go dependency graph, and use automated dependency monitoring for controlled upgrades. 5. Document an explicit update procedure so version changes receive security review before deployment. 6. Avoid recommending an unpinned `git clone`; check out a verified release tag or commit hash when building from source. 7. Run installation and the resulting binary as a non-privileged user with access only to the files required for its operation. ]]>
