T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:45
- Finding
- Unverified Remote Script Downloaded and Executed Through a Shell Pipeline<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:45-48` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash # Install nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash ``` ### Technical Analysis The installation instructions pipe content retrieved from an external URL directly into Bash. Although the URL appears to reference the upstream `nvm-sh/nvm` GitHub repository and a version tag, the downloaded content is not verified using a cryptographic checksum or signature and cannot be reviewed before execution. The effective payload therefore depends on content delivered at execution time rather than content included in the audited Skill. Compromise of the upstream account, repository, release reference, hosting infrastructure, TLS trust chain, or local network configuration could turn this instruction into arbitrary code execution. The NVM installer may also modify persistent shell initialization files such as `~/.bashrc`. Installing NVM is not necessary when a compatible Node.js runtime is already available, so unconditional execution exceeds the minimum access required by the Skill. ### Attack Path 1. An attacker compromises or gains control over content delivered from the referenced external source, or redirects the request through a compromised trust path. 2. The Skill executes the documented `curl` command. 3. `curl` writes the remotely supplied content to standard output. 4. Bash executes that content immediately without checksum validation or user inspection. 5. The payload runs with all permissions of the user invoking the Skill. 6. The payload can read or modify user-accessible files, credentials, project content, and shell configuration. If invoked from an elevated shell, its impact expands accordingly. ### Impact Assessment Successful exploitation provides arbitrary command execution under the invoking user's account. Th ...[truncated 406 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | bash` pipeline entirely. 2. Detect whether a compatible Node.js runtime is already present before installing anything. 3. Require explicit user approval before changing the runtime or shell configuration. 4. If NVM must be installed: - Download the installer into a temporary file. - Pin an immutable release artifact. - Verify a publisher-provided SHA-256 digest or cryptographic signature. - Display or inspect the downloaded script before execution. - Execute it as a separate step only after successful verification. 5. Prefer a trusted system package manager or a pre-provisioned runtime in a controlled environment. 6. Run installation without elevated privileges and document any persistent changes made to shell initialization files. ]]>
