T03 · Remote Payload Retrieval and Execution
Error
- Location
- setup_binance_20euros.sh:37
- Finding
- Mutable Remote Trading Code Is Downloaded and Executed Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `setup_binance_20euros.sh:37-68`, with execution at `setup_binance_20euros.sh:167-190` **Vulnerability Type**: Mutable remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash if [ ! -f "$EXECUTOR_PATH" ]; then echo "" echo "❌ executor.py not found. Installing from GitHub..." wget -q "https://raw.githubusercontent.com/georges91560/crypto-executor/main/executor.py" \ -O "$EXECUTOR_PATH" if [ ! -f "$EXECUTOR_PATH" ]; then echo "❌ Download failed. Install manually:" echo " wget https://raw.githubusercontent.com/georges91560/crypto-executor/main/executor.py \\" echo " -O $EXECUTOR_PATH" exit 1 fi echo "✅ executor.py installed" else echo "✅ executor.py found" fi ORACLE_PATH="/workspace/skills/crypto-sniper-oracle/crypto_oracle.py" if [ ! -f "$ORACLE_PATH" ]; then echo "" echo "⚠️ crypto-sniper-oracle not found. Installing..." mkdir -p /workspace/skills/crypto-sniper-oracle wget -q "https://raw.githubusercontent.com/georges91560/crypto-sniper-oracle/main/crypto_oracle.py" \ -O "$ORACLE_PATH" ``` The downloaded executor is subsequently launched: ```bash source "$CONFIG_FILE" if systemctl list-unit-files crypto-executor.service &>/dev/null; then sudo systemctl start crypto-executor # ... fi nohup python3 "$EXECUTOR_PATH" > /workspace/logs/binance_bot.log 2>&1 & ``` ### Technical Analysis Both Python programs are retrieved from the mutable `main` branches of personal GitHub repositories. No commit pin, release signature, expected SHA-256 digest, content validation, or review gate is enforced. Checking only whether the destination file exists does not establish that the download succeeded completely or that its contents are trustworthy. The main executor is then run with Binance credentials loaded into its environment. Project documentation also states that the ora ...[truncated 1667 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Vendor the reviewed Python files into the audited release, or pin downloads to immutable full commit hashes. 2. Publish expected SHA-256 hashes in the Skill package and verify them before installation: ```bash printf '%s %s\n' "$EXPECTED_SHA256" "$EXECUTOR_PATH" | sha256sum -c - ``` 3. Abort on any download or verification error. Use `curl --fail --show-error --location` or check `wget`'s exit status rather than checking only for file existence. 4. Download to a temporary file created with `mktemp`, verify it, then atomically move it into place. 5. Require explicit user confirmation after displaying the source revision and verified digest. 6. Run the trading process under a dedicated unprivileged account with a restrictive systemd sandbox. 7. Restrict Binance keys to trading-only permissions, disable withdrawals, use IP allowlisting, and use a dedicated sub-account with limited capital. 8. Treat the executor and oracle as separate reviewed artifacts with independent hashes and release provenance. ]]>
