T03 · Remote Payload Retrieval and Execution
- Location
scripts/download_photoplus_album.py:53- Finding
Mutable Remote Code Is Downloaded and Executed Without Integrity Verification
- Content
View full analysis
Path: script = repo_dir / "live_album_downloader.py" if script.exists(): return script repo_dir.parent.mkdir(parents=True, exist_ok=True) if shutil.which("git"): try: run(["git", "clone", "--depth", "1", REPO_URL, str(repo_dir)]) return script except subprocess.CalledProcessError: pass repo_dir.mkdir(parents=True, exist_ok=True) print(f"+ download {RAW_SCRIPT_URL} -> {script}", flush=True) urllib.request.urlretrieve(RAW_SCRIPT_URL, script) return script ``` ```python script = ensure_upstream(args.repo_dir) if args.install_deps: install_dependencies(args.repo_dir) args.workdir.mkdir(parents=True, exist_ok=True) run(build_args(args, activity_id, script.resolve()), cwd=args.workdir) ``` ### Technical Analysis The wrapper dynamically retrieves an executable Python program from an external GitHub repository. The Git path performs a shallow clone of the current default branch, while the fallback downloads `live_album_downloader.py` directly from the mutable `main` branch. The downloaded program is subsequently executed using the current Python interpreter without verifying a commit identifier, cryptographic checksum, or digital signature. HTTPS protects transport integrity but does not prevent the upstream repository owner, a compromised maintainer account, or an attacker controlling the repository from changing the effective ...[truncated 1546 chars]- Remediation
View remediation
