T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:36
- Finding
- Unverified Remote Installer Is Executed with Root Privileges<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:36-40` **Vulnerability Type**: Remote payload retrieval and privileged execution **Risk Level**: Critical ### Vulnerable Code ```bash If it is missing, install it: ```bash curl -fsSL --connect-timeout 1000 https://sysom-prd-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/sysom_prd/skill_cli/install.sh | sudo bash ``` ``` ### Technical Analysis The documented installation procedure retrieves a shell script from a remote OSS URL and streams it directly into a root shell. The payload is not pinned to a version and is not verified using a cryptographic hash or trusted publisher signature before execution. HTTPS protects the download in transit, but it does not protect against compromise of the hosting account, replacement of the hosted object, erroneous publication, or loss of control over the distribution infrastructure. Because the object is mutable, the code ultimately executed can differ from the code reviewed during this audit. Piping the response directly to `sudo bash` also prevents meaningful inspection before execution and grants the downloaded payload unrestricted root-level access. This exceeds the privileges needed merely to download or invoke an ECS inspection client. ### Attack Path 1. An attacker compromises the OSS object, its publishing credentials, or the associated release process. 2. The attacker replaces `install.sh` with a malicious payload. 3. A user or agent follows the Skill setup instructions because `sysom-osops` is unavailable. 4. `curl` retrieves the modified script without checking a pinned digest or signature. 5. The script is passed directly to `sudo bash`. 6. The attacker-controlled code executes as root and can modify the host, collect credentials, establish persistence, or download additional payloads. ### Impact Assessment Successful exploitation provides arbitrary code execution with root privileges on the machine where the Skill is installed. The payload could ...[truncated 539 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | sudo bash` installation pattern. 2. Distribute a versioned, immutable installer or package with a pinned release identifier. 3. Publish a SHA-256 digest through a separately protected channel and verify it before execution. 4. Sign release artifacts and validate the publisher signature using a pinned public key. 5. Download the installer to a local file, validate it, and permit inspection before running it. 6. Avoid running the entire installer as root. Separate the specific operations requiring elevation and execute only those operations with `sudo`. 7. Prefer installation through a trusted package repository with signed metadata and version pinning. 8. Ensure updates require the same integrity checks rather than retrieving a mutable latest-version payload. 9. Document the exact files, permissions, services, and network endpoints used by the installer so its privilege requirements can be independently reviewed. A safer workflow would resemble: ```bash curl -fSLo sysom-install.sh "https://trusted.example/versioned/sysom-install-0.2.0.sh" echo "<PINNED_SHA256> sysom-install.sh" | sha256sum --check - # Verify a publisher signature as well. less sysom-install.sh bash sysom-install.sh ``` Any individual operation that genuinely requires root access should request elevation separately rather than granting root privileges to the entire downloaded script. ]]>
