T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:13
- Finding
- Unverified Remote Installation Script Executed Directly by a Shell## Vulnerability Details **File Location**: `SKILL.md`, line 13 **Vulnerability Type**: `T03: Remote Payload Retrieval and Execution` **Risk Level**: High **Vulnerable Code:** ```markdown - **Install** (script): `curl -sSL https://raw.githubusercontent.com/fiatjaf/nak/master/install.sh | sh` ``` ### Technical Analysis The installation command retrieves a shell script from the mutable `master` branch of an external personal GitHub repository and immediately pipes the response into `sh`. The downloaded content is not pinned to a reviewed commit or release and is not authenticated with a publisher signature or verified against a checksum. Consequently, the code executed during installation can change after the Skill itself has been reviewed. The remote script is not included in the audited project, so its behavior and any files, commands, or secondary payloads it uses cannot be verified by this audit. The optional recommendation elsewhere in the document to review the script does not make the displayed installation command safe. The documented update procedure also instructs users to rerun this command to install the latest version, repeatedly exposing them to mutable remote code. Although installing `nak` supports the Skill's declared functionality, direct unverified execution is not the least-privilege or minimum-risk way to provide that dependency. ### Attack Path 1. An agent or user follows the installation or update instructions in `SKILL.md`. 2. `curl` requests the current `install.sh` content from the repository's mutable `master` branch. 3. An attacker who compromises the repository, maintainer account, delivery path, or installation script substitutes malicious shell commands. 4. The response is passed directly to `sh` without local inspection, version pinning, checksum verification, or signature validation. 5. The malicious commands execute with the permissions of the user or agent running the installation. 6. Th ...[truncated 858 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the `curl | sh` installation pattern. 2. Pin installation to a specific audited release, immutable commit, or versioned artifact rather than the mutable `master` branch. 3. Download the artifact to a local file before execution so it can be inspected: ```bash curl --fail --show-error --location --output install.sh \ "https://raw.githubusercontent.com/fiatjaf/nak/<PINNED_COMMIT>/install.sh" ``` 4. Publish and verify a trusted SHA-256 checksum and, preferably, a cryptographic publisher signature before running the downloaded file. 5. Review the downloaded script and its secondary downloads, then execute it explicitly only after verification. 6. Prefer a trusted, version-pinned package manager or signed release binary when the upstream project provides one. 7. Perform installation in a restricted environment without `NOSTR_SECRET_KEY` or unrelated credentials in scope. 8. Do not request elevated privileges unless a reviewed installation step demonstrably requires them. Install to a user-controlled directory where possible. 9. Document an explicit, version-pinned update process that repeats all integrity and authenticity checks rather than automatically installing the latest mutable content.
