T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:127
- Finding
- Mutable Remote Installer Is Downloaded and Executed Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 127–129 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash wget "https://aliyun-observability-release-${REGION_ID}.oss-${REGION_ID}.aliyuncs.com/loongcollector/linux64/latest/loongcollector.sh" -O loongcollector.sh chmod +x loongcollector.sh ./loongcollector.sh install "${REGION_ID}" ``` ### Technical Analysis The skill downloads an executable shell script from a mutable `latest` URL and immediately runs it. It does not pin a specific collector version or verify a cryptographic checksum or digital signature before execution. Although HTTPS provides transport protection, it does not establish that the downloaded object is the exact artifact reviewed by the skill author. The effective code can change after the skill package has been audited if the remote object is replaced, the release infrastructure is compromised, or the upstream publisher serves a malicious update. This is a direct remote payload execution channel: the behavior ultimately executed on the host is determined by an external mutable resource rather than by the audited contents of the skill. ### Attack Path 1. An attacker compromises the Alibaba Cloud release bucket, release account, publication pipeline, or another component capable of modifying the `latest/loongcollector.sh` object. 2. The attacker replaces the remote installer with a modified shell script. 3. A user invokes the skill on a host where LoongCollector is not already running. 4. The skill downloads the attacker-controlled object as `loongcollector.sh`. 5. The skill marks the file executable and runs it without validating its version, checksum, or signature. 6. The payload executes with the privileges of the invoking process. If the installer invokes `sudo`, or the skill itself is run as root, the payload may obtain root-level control. ### Impact Assessment Successful exploitation permits arbitr ...[truncated 618 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the mutable `latest` path with a pinned, explicitly approved LoongCollector version. 2. Obtain the expected SHA-256 digest from a separately authenticated vendor channel and verify it before execution: ```bash EXPECTED_SHA256="<vendor-published-digest>" printf '%s %s\n' "$EXPECTED_SHA256" loongcollector.sh | sha256sum --check - ``` 3. Prefer vendor-signed packages and verify the package signature against a pinned vendor public key. 4. Download into a securely created temporary directory using `mktemp -d`, and remove the artifact after installation. 5. Use strict download options such as `--https-only`, appropriate timeouts, and failure-on-error behavior. 6. Abort installation on any checksum, signature, ownership, or permission mismatch. 7. Review the pinned installer before approving a version update rather than automatically following the newest upstream payload. 8. Run installation with the minimum privileges possible and isolate any explicitly required privileged operations. ]]>
