T03 · Remote Payload Retrieval and Execution
Warning
- Location
- scripts/self_check.py:126
- Finding
- Unverified Remote Installer Recommended for Direct Shell Execution## Vulnerability Details **File Location**: `scripts/self_check.py:126` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Medium ```python result.add_issue("nvm 不可用", "安装 nvm: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash", "warning") ``` ### Technical Analysis The self-check report recommends downloading an installation script from an external URL and piping it directly into `bash`. This pattern executes the response before the user can inspect it and provides no checksum, cryptographic-signature, or content verification. The referenced URL belongs to the expected `nvm-sh/nvm` GitHub repository and is pinned to version `v0.39.0`, rather than an apparent personal paste site. Nevertheless, direct remote-to-shell execution remains unsafe: compromise of the upstream repository, hosting account, release reference, delivery infrastructure, or local trust chain could cause arbitrary shell commands to run. The Python script only prints this command as remediation advice; it does not download or execute the installer automatically. Exploitation therefore requires a user to follow the generated recommendation manually. Even with this limitation, presenting the command as the standard fix creates a credible social execution path and is unnecessary for the Skill's declared read-only diagnostic function. ### Attack Path 1. The self-check determines that `nvm` is unavailable. 2. It displays the `curl ... | bash` command as a recommended repair. 3. The user trusts the diagnostic report and manually executes the command. 4. `curl` retrieves the current response from the external hosting service. 5. `bash` immediately executes that response without integrity verification or prior review. 6. If the retrieved content has been maliciously modified, it runs arbitrary commands with the invoking user's privileges. ### Impact Assessment A compromised payload would obtain the p ...[truncated 553 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the `curl | bash` recommendation. 2. Prefer installation through a trusted operating-system package manager where a maintained package is available. 3. If upstream installation is required, instruct the user to download a version-pinned installer to a local file without executing it: ```bash curl --fail --proto '=https' --tlsv1.2 \ --output install-nvm.sh \ https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh ``` 4. Verify the downloaded file against an independently published cryptographic checksum or signature. Do not obtain both the artifact and its integrity value solely through the same untrusted delivery path. 5. Require the user to inspect the local script before execution. 6. Execute it only after explicit confirmation and with an unprivileged account: ```bash bash install-nvm.sh ``` 7. Consider recommending the latest supported, security-reviewed nvm release rather than the old `v0.39.0` installer, while retaining an immutable version pin and documented integrity value. 8. Keep the Skill read-only: it should continue reporting missing dependencies without automatically downloading, installing, or modifying anything.
