T03 · Remote Payload Retrieval and Execution
- Location
SKILL.md:178- Finding
Unverified Remote Script Execution Through curl-to-shell Pipeline
- Content
View full analysis
`, ``, `` with actual values 2. Upload the script to the GitHub repo (commit + push from Mac A) 3. On Mac B, run one command: curl -sSL -H "Authorization: token " \ "https://raw.githubusercontent.com//wb-sync/main/wb-setup-mac-b.sh" | bash ``` ### Technical Analysis The documented command downloads a shell script from the mutable `main` branch and immediately executes it with `bash`. It does not pin an immutable commit, verify a cryptographic hash or signature, save the script for inspection, or confirm its contents with the user. Although the documented host is GitHub, the effective payload remains controlled by whoever has write access to the synchronization repository. The payload can change after this Skill has been reviewed. The GitHub token is also passed as a command-line argument to `curl`, which can expose it to local process inspection while the command is running. ### Attack Path 1. An attacker compromises the GitHub account, repository, or a token with repository write permission. 2. The attacker replaces `wb-setup-mac-b.sh` on the `main` branch with malicious shell commands. 3. A user follows the documented one-line installation command on another Mac. 4. `curl` retrieves the attacker-controlled version. 5. The pipeline passes the response directly to `bash`. 6. The malicious commands execute with all permissions available to the current macOS user. 7. The payload can modify user files, steal accessible credentials, alter WorkBuddy configuration, or install additional persistence. ### Impact Assessment Successful exploitation provides arbitrary command execution in the context of the user running the setup command. This normally does not grant root privileges automatical ...[truncated 260 chars]- Remediation
View remediation
/wb-sync//wb-setup-mac-b.sh" ``` 3. Pin the URL to an immutable reviewed commit rather than `main`. 4. Publish a trusted SHA-256 digest or cryptographic signature through a separate trusted channel and verify it before execution. 5. Prompt the user to inspect and explicitly approve the downloaded script. 6. Avoid placing access tokens directly in command-line arguments. Use a secure credential helper or a temporary configuration with appropriately restricted permissions. 7. Use a fine-grained, short-lived token limited to the single synchronization repository. ]]>
