T03 · Remote Payload Retrieval and Execution
- Location
setup.sh:81- Finding
Unpinned Remote Source Fallback Permits Mutable Payload Execution
- Content
View full analysis
/dev/null 2>&1; then echo " ⚠ Binary failed (glibc mismatch?). Building from source..." if command -v cargo >/dev/null 2>&1; then cargo install --git "https://github.com/${REPO}" --root "${WORKSPACE}/.cargo-mirage" cp "${WORKSPACE}/.cargo-mirage/bin/mirage-proxy" "${MIRAGE_BIN}" else echo " ✗ No cargo found. Install Rust: https://rustup.rs" exit 1 fi fi ``` The checksum function also explicitly permits installation without verification: ```bash else echo " ⚠ No sha256sum or shasum found — skipping integrity check" return 0 fi ``` ### Technical Analysis The script retrieves a native executable from an external GitHub release and runs it locally. Although checksums are defined for supported platforms, verification fails open when neither `sha256sum` nor `shasum` is available. More critically, if the downloaded binary does not pass the `--version` execution check, the fallback runs: ```bash cargo install --git "https://github.com/${REPO}" --root "${WORKSPACE}/.cargo-mirage" ``` This command does not specify an immutable commit through `--rev`. Consequently, it builds whichever revision ...[truncated 2088 chars]- Remediation
View remediation
" \ --locked \ --root "${WORKSPACE}/.cargo-mirage" ``` 2. Fail closed when no supported checksum utility is available. Never execute an artifact whose digest has not been verified. 3. Download into a securely created temporary directory and do not mark the file executable until verification succeeds. 4. Use `curl --fail --show-error --location` and verify that the response is a successful artifact download. 5. Verify both release artifacts and source-build outputs against independently maintained, reviewed digests or signatures. 6. Prefer bundling auditable source code or a reviewed artifact with the Skill rather than downloading mutable executable content during installation. 7. Run the proxy under a dedicated least-privilege account or a restricted container with narrowly scoped filesystem and network permissions. 8. Document what request headers and environment variables the proxy can access, and avoid exposing credentials not required for forwarding. ]]>
