T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:135
- Finding
- Unverified Remote Installation Scripts Are Executed Directly by a Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:127-138` and `SKILL.md:397-400` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash # Agent usage npx skills add laiye-ai/adp-cli -y -g # npm (recommended) npm install -g @laiye-adp/agentic-doc-parse-and-extract-cli # Linux / macOS curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash # Windows (PowerShell) irm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex ``` The error-handling instructions also require automatic installation: ```text | ADP CLI not installed | Automatically execute the installation script | ``` ### Technical Analysis The Linux/macOS command pipes remotely retrieved content directly into `bash`. The Windows command has equivalent behavior by piping the result of `Invoke-RestMethod` into `Invoke-Expression`. Both URLs reference the mutable `main` branch rather than an immutable commit or signed release. The instructions provide no checksum, cryptographic signature, source review, or separate download-and-confirmation step. Consequently, the effective code executed by the Skill can change after the Skill package has been audited. The risk is amplified by the instruction to execute the installation script automatically when the ADP CLI is missing. This may eliminate an explicit user approval boundary and cause an Agent to execute newly retrieved code based only on the local absence of a command. Although the URL belongs to a repository associated with the declared vendor, repository ownership alone does not establish the integrity of every future response from a mutable branch. ### Attack Path 1. An attacker compromises the referenced repository, a maintainer account, the `main` branch, or the artifact-delivery trust chain. 2. The attacker modifies `adp-init.sh` or `adp-init.ps1` to include arbitrary malicious commands. 3. A user or ...[truncated 1180 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | bash` and `irm | iex` installation patterns. 2. Do not automatically install software merely because the CLI is absent. Stop and request explicit user approval. 3. Distribute the installer as a versioned release artifact rather than retrieving it from a mutable branch. 4. Pin the artifact to an immutable version or commit. 5. Download the artifact to a local file before execution. 6. Publish and verify a cryptographic checksum or signature using a trusted verification key. 7. Display the artifact source, version, checksum, destination, and required privileges before execution. 8. Permit users to inspect the downloaded script before running it. 9. Execute installation with ordinary user privileges and avoid `sudo` or elevated PowerShell unless strictly required and separately approved. 10. Prefer a verified package-manager installation with an exact version and integrity metadata. A safer conceptual workflow is: ```bash curl -fL -o adp-init.sh "https://trusted.example/releases/vX.Y.Z/adp-init.sh" echo "<EXPECTED_SHA256> adp-init.sh" | sha256sum --check - less adp-init.sh bash adp-init.sh ``` The expected hash must come from an authenticated, independently verifiable release channel rather than the same mutable location as the script. ]]>
