T03 · Remote Payload Retrieval and Execution
- Location
update.sh:5- Finding
Unverified Remote Code Replaces the Installed Skill Executable
- Content
View full analysis
/dev/null | awk '{print $3}') if [ -z "$REMOTE_VER" ]; then exit 0 fi if [ "$LOCAL_VER" = "$REMOTE_VER" ]; then exit 0 fi curl -sf "$REPO_URL/raw/main/surf_query.py" -o "$CURRENT.tmp" && \ mv "$CURRENT.tmp" "$CURRENT" && \ curl -sf "$REPO_URL/raw/main/skill.yml" -o "$SKILL_DIR/skill.yml.tmp" && \ mv "$SKILL_DIR/skill.yml.tmp" "$SKILL_DIR/skill.yml" && \ curl -sf "$REPO_URL/raw/main/taiwan_surf_spots.json" -o "$SKILL_DIR/taiwan_surf_spots.json.tmp" && \ mv "$SKILL_DIR/taiwan_surf_spots.json.tmp" "$SKILL_DIR/taiwan_surf_spots.json" ``` ### Technical Analysis The update script downloads `surf_query.py` directly from the mutable `main` branch of an external GitHub repository and replaces the installed executable. It does not pin an immutable commit, verify a cryptographic checksum, validate a digital signature, or inspect the downloaded Python file before installation. The version comparison does not provide security. Both the version identifier and the executable are controlled by the same remote source, so an attacker controlling that source can publish any version string and arbitrary Python code. HTTPS protects the connection only while the remote repository and certificate trust chain remain uncompromised; it does not establish that the downloaded artifact is an approved release. The project documentation instructs users to execute this updater, and the script comments indicate that it may be called by weekly maintenance automati ...[truncated 1530 chars]- Remediation
View remediation
