T03 · Remote Payload Retrieval and Execution
- Location
scripts/install.py:134- Finding
Mutable Remote Executable Is Downloaded and Made Executable Without Integrity Verification
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install.py:34-54, 134-167
Vulnerability Type: Remote payload retrieval and execution
Risk Level: HighComplete Code Snippet
python def download_binary(url, dest_path): """Download a file from url to dest_path with progress indication.""" print(f"Downloading binary from: {url}") print(f"Saving to: {dest_path}") req = urllib.request.Request( url, headers={'User-Agent': 'RollingGo-Installer/1.0'} ) try: with urllib.request.urlopen(req) as response: with open(dest_path, 'wb') as out_file: shutil_copy(response, out_file) print("✅ Download completed successfully!") return True except Exception as e: print(f"❌ Download failed: {e}") return Falsepython # Try fetching from GitHub API assets, tag = get_latest_release_assets() download_url = None if assets: for asset in assets: name = asset.get('name', '').lower() # Match keywords (e.g. 'win' or 'windows' for Windows, 'macos' for Mac, 'linux' for Linux) if asset_keyword in name: download_url = asset.get('browser_download_url') print(f"Found matching asset for version {tag}: {asset.get('name')}") break # Fallback to hardcoded URL patterns if API fails or asset not found if not download_url: print("Using hardcoded fallback download URL...") if system == "windows": download_url = "https://github.com/RollingGo-AI/oauth-hotel-cli/releases/latest/download/rgh-win.exe" elif system == "darwin": download_url = "https://github.com/RollingGo-AI/oauth-hotel-cli/releases/latest/download/rgh-macos" else: download_url = "https://github.com/RollingGo-AI/oauth-hotel-cli/releases/latest/download/rgh-linux" success = download_binary(download_url, dest_path) ...[truncated 3397 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the installer to a specific audited release version rather than using
latest. - Bundle expected SHA-256 or stronger digests for every supported operating-system and architecture artifact.
- Verify the digest before assigning executable permissions or moving the file into the final
bindirectory. - Prefer cryptographically signed releases and verify signatures against a trusted public key bundled with the reviewed Skill.
- Store release metadata and checksums in a separately protected, versioned channel so compromise of the binary publication path alone is insufficient.
- Map exact asset names to supported operating-system and CPU architecture combinations; reject unexpected or ambiguous assets.
- Download into a securely created temporary file, enforce a reasonable size limit, verify it, and then atomically rename it into place.
- Reject unexpected redirects or validate that the final response URL belongs to an explicitly approved GitHub release-asset domain.
- Require explicit user approval before replacing an existing executable.
- Remove the mandatory automatic-upgrade rule in
SKILL.md:62; updates should be pinned, reviewed, integrity-checked, and user-approved.
- Pin the installer to a specific audited release version rather than using
