T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:169
- Finding
- Mutable Remote JavaScript Is Downloaded and Executed Without Verification<: npx aiscan-cli <url> - zero-install terminal scanner (also published as @aiscan/cli; npm i -g aiscan-cli for the short "aiscan" command) with JSON/Markdown output, CI gates and agent fix prompts - [CLI script](https://aiscan.site/cli.mjs): fallback for environments without npm, curl -fsSL https://aiscan.site/cli.mjs | node - example.com ``` ### Technical Analysis The documented shell pipeline downloads JavaScript from a live HTTPS endpoint and immediately passes it to Node.js. The downloaded payload is not pinned to a version and is not checked using a cryptographic digest or trusted signature. It is also not saved for inspection before execution. Consequently, the effective code executed by the Skill user can change after the package has been reviewed. HTTPS protects the connection in transit but does not protect against compromise of the source domain, DNS, hosting account, deployment pipeline, or maintainers' credentials. This behavior is not necessary for the declared website-scanning functionality because the Skill already documents a REST API that can be invoked using `curl` without executing downloaded code. ### Attack Path 1. An attacker compromises `aiscan.site`, its deployment pipeline, DNS configuration, or the account controlling `cli.mjs`. 2. The attacker replaces the JavaScript resource with a malicious payload. 3. An agent or user follows the documented fallback command. 4. `curl` retrieves the attacker's current payload. 5. The shell pipes the response direc ...[truncated 1087 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | node` command from all documentation and reference assets. 2. Prefer the existing REST API workflow, which only transmits a target URL and parses data rather than executing remote code. 3. If a CLI is required, distribute a reviewed, versioned artifact from a controlled release channel. 4. Publish a SHA-256 digest or signed release manifest and require verification before execution. 5. Download the artifact to a local file first, verify its integrity and provenance, and present it for review before running it. 6. Use an immutable versioned URL rather than a mutable path such as `/cli.mjs`. 7. Run any downloaded CLI in a restricted environment with minimal filesystem access, no unnecessary credentials, and limited outbound networking. 8. Keep bundled reference documentation consistent so the unsafe fallback is not reintroduced from `assets/llms.txt`. ]]>
