T03 · Remote Payload Retrieval and Execution
- Location
scripts/imc_publish.py:27- Finding
Mutable, Unverified Remote Source Can Replace Installed Skill Code and Instructions
- Content
View full analysis
None: installed = _skill_version(SKILL_DIR) if not installed: _die(f"{SKILL_DIR} does not look like an imc-publish install (no SKILL.md)") with tempfile.TemporaryDirectory() as tmp: archive_path = os.path.join(tmp, "source.tar.gz") try: with urllib.request.urlopen(SOURCE_TARBALL, timeout=120) as response: with open(archive_path, "wb") as out: shutil.copyfileobj(response, out) except (urllib.error.HTTPError, urllib.error.URLError) as exc: _die(f"cannot download the update: {exc}", 3) source = _extract_verified(archive_path, os.path.join(tmp, "unpacked")) latest = _skill_version(source) if not latest or not os.path.isfile(os.path.join(source, "scripts", "imc_publish.py")): _die("downloaded archive is not a valid imc-publish release") if _version_tuple(latest) <= _version_tuple(installed): print(f"Already up to date (v{installed}).") return for extra in ("install.sh", "uninstall.sh"): path = os.path.join(source, extra) if os.path.exists(path): os.remove(path) shutil.copytree(source, SKILL_DIR, dirs_exist_ok=True) print(f"Updated imc-publish {installed} -> {latest} in {SKILL_DIR}") print("Your API key was not touched.") ``` ### Technical Analysis The update command retrieves an archive from the mutable GitHub `main` branch and copies its contents over the installed Skill directory. It validates archive paths and checks for expected files, but it does not verify a cryptograp ...[truncated 1978 chars]- Remediation
View remediation
