T03 · Remote Payload Retrieval and Execution
- Location
scripts/install_dedao_dl.py:25- Finding
Unverified Mutable Third-Party Executable Download and Execution
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install_dedao_dl.py:25-29, 64-76; execution requirement inSKILL.md:12-22
Vulnerability Type: Unverified remote executable retrieval and supply-chain risk
Risk Level: HighVulnerable Code
python api_url = "https://api.github.com/repos/yann0917/dedao-dl/releases/latest" try: req = urllib.request.Request(api_url, headers={'User-Agent': 'Mozilla/5.0'}) with urllib.request.urlopen(req) as response: data = json.loads(response.read().decode())python download_url = download_asset["browser_download_url"] file_name = download_asset["name"] print(f"Downloading {file_name} from {download_url}...") try: urllib.request.urlretrieve(download_url, target_exe) print("Download complete.") # Make script executable on Unix systems if system != "windows": st = os.stat(target_exe) os.chmod(target_exe, st.st_mode | stat.S_IEXEC) print(f"Setup successful. You can now use ./{target_exe} (or .\\{target_exe} on Windows)")The corresponding mandatory instruction is:
markdown **MANDATORY FIRST STEP:** Before using any `dedao-dl` commands for the first time, you MUST run the installation script and verify the CLI is available. Run the script to download the latest binary for the current OS: ```bash python scripts/install_dedao_dl.pytext ### Technical Analysis The installer resolves the mutable GitHub `latest` release and downloads an executable selected from release metadata. It does not pin a reviewed release version or asset, verify a hard-coded cryptographic checksum, validate a publisher signature, enforce an expected download size, or otherwise authenticate the downloaded binary independently of the distribution channel. The downloaded file is subsequently granted executable permission. Because the effective program is obtained after review and can change whenever th ...[truncated 1904 chars]- Remediation
View remediation
Remediation Suggestions
- Pin an explicitly reviewed
dedao-dlrelease version rather than resolvingreleases/latest. - Pin the exact expected asset name for each supported operating system and architecture.
- Store an independently obtained SHA-256 or stronger digest for each approved asset and verify it before renaming or executing the download.
- Prefer signed release artifacts and verify the signature against a pinned, trusted publisher key.
- Download into a newly created temporary file with restrictive permissions, validate it, and atomically move it into the fixed installation location only after all checks succeed.
- Reject unexpected redirects, final hosts, content types, file sizes, and platform formats.
- Require explicit user approval before downloading or executing third-party native code; do not make installation an unconditional mandatory action.
- Run the executable in a sandbox with minimal filesystem and network access. Avoid exposing unrelated environment variables or credentials.
- Document the precise upstream version, digest, signer identity, and update procedure so dependency updates receive security review.
- Pin an explicitly reviewed
