T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:359
- Finding
- Mutable Remote Installer Is Piped Directly into a Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:359-362` **Vulnerability Type**: Unverified remote code execution **Risk Level**: Critical ### Vulnerable Code ```bash Install `nak` CLI: ```bash curl -sSL https://raw.githubusercontent.com/fiatjaf/nak/master/install.sh | sh ``` ``` ### Technical Analysis The installation instructions download a shell script from the mutable `master` branch of a third-party GitHub repository and immediately execute it. The command does not pin an immutable commit, verify a checksum or signature, or provide an opportunity to review the downloaded artifact before execution. Consequently, the code that executes can change after this Skill has been reviewed. A compromise of the repository, maintainer account, release process, DNS or TLS trust chain could turn this prerequisite into arbitrary code execution. Executing a remote installer is not required for the Skill’s core DID functionality and exceeds the minimum privileges necessary for documenting a Nostr CLI prerequisite. ### Attack Path 1. An attacker compromises the referenced repository or its maintainer account, or otherwise causes malicious content to be served from the URL. 2. The attacker modifies `install.sh` on the mutable `master` branch. 3. A user follows the Skill’s documented prerequisite command. 4. `curl` downloads the modified content and streams it directly to `sh`. 5. The payload executes with the user’s privileges before its contents or integrity can be inspected. 6. The payload can access the user’s Archon wallet, plaintext passphrase file, Nostr key, files, network credentials, and any other resources available to that account. ### Impact Assessment Successful exploitation grants arbitrary command execution with all privileges of the invoking user. In the expected deployment context, that account may have access to: - `~/.archon.env`, including `ARCHON_PASSPHRASE` - `~/.archon.wallet.json` - `~/.clawstr/secret.key` - Derived identity k ...[truncated 227 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | sh` instruction. 2. Use an immutable, reviewed release artifact or commit rather than a mutable branch. 3. Download the artifact separately and verify a maintainer-published cryptographic signature or pinned SHA-256 checksum before execution. 4. Display or document the downloaded script so users can review it before running it. 5. Prefer a trusted operating-system package manager or an official, versioned release channel. 6. Run installation without wallet secrets loaded into the environment and with the least privileges possible. 7. Document the exact expected version and integrity value. A safer pattern is: ```bash curl --fail --show-error --location \ --output nak-install.sh \ "https://raw.githubusercontent.com/fiatjaf/nak/<immutable-commit>/install.sh" printf '%s %s\n' '<trusted-sha256>' 'nak-install.sh' | sha256sum --check - less nak-install.sh sh nak-install.sh ``` ]]>
