T08 · Insecure Dependencies
Warning
- Location
- scripts/install.sh:35
- Finding
- Unpinned Go Dependency Allows Unreviewed Upstream Code Installation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install.sh`, lines 35–51 **Vulnerability Type**: Mutable and unverified third-party dependency **Risk Level**: Medium ### Vulnerable Code ```bash # Default to @latest when no version specified. VERSION="${VERSION:-@latest}" echo "=== Installing Aperture ===" echo "" # Verify Go is installed. if ! command -v go &>/dev/null; then echo "Error: Go is not installed." >&2 echo "Install Go from https://go.dev/dl/" >&2 exit 1 fi echo "Go version: $(go version | grep -oE 'go[0-9]+\.[0-9]+')" echo "" # Install aperture. echo "Installing aperture..." go install "github.com/lightninglabs/aperture/cmd/aperture${VERSION}" ``` ### Technical Analysis When no version is supplied, the installation script uses the mutable `@latest` selector. Consequently, the code installed by the Skill can change after the Skill itself has been reviewed. The script does not pin an audited Aperture release or independently verify the selected source revision or resulting binary. The repository path is consistent with the declared Aperture project, and no evidence indicates that it is currently malicious. Nevertheless, relying on a mutable upstream version creates a supply-chain trust boundary. Compromise of the upstream repository, release process, a dependency, or relevant module-distribution infrastructure could cause users to install an altered binary. The installed Aperture binary is later run with access to the configuration paths for an LND TLS certificate and invoice macaroon. These resources are necessary for the declared L402 functionality, but they increase the consequences of executing an unreviewed version. ### Attack Path 1. An attacker compromises the upstream Aperture repository, its release process, or one of the dependencies selected by the latest release. 2. The attacker publishes a newer version that contains malicious behavior. 3. A user runs `scripts/install.sh` without specifying `--version ...[truncated 1019 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace `@latest` with a specific, reviewed release: ```bash DEFAULT_VERSION="v0.4.2" VERSION="@${DEFAULT_VERSION}" ``` 2. Maintain an explicit allowlist of supported versions rather than accepting arbitrary module selectors. 3. Record and review the expected Go module checksums in a controlled `go.sum` by building from a pinned module checkout. 4. For higher-assurance deployment, publish a verified binary and validate it against a hardcoded SHA-256 digest before installation. 5. Treat version updates as security-relevant changes and require review before changing the pinned version. 6. Document that installation and execution should occur as an unprivileged, dedicated service account with access only to the invoice-specific macaroon required by Aperture. ]]>
