T03 · Remote Payload Retrieval and Execution
- Location
scripts/artclaw.py:53- Finding
Unsigned Mutable Self-Update Replaces Executable Skill Files
- Content
View full analysis
dict: """Extract a GitHub main.zip archive over repo_root.""" import io import zipfile import shutil import tempfile with zipfile.ZipFile(io.BytesIO(archive_zip_bytes)) as zf: names = zf.namelist() prefix = names[0] if names[0].endswith("/") else names[0].split("/")[0] + "/" incoming: Dict[str, bytes] = {} with zipfile.ZipFile(io.BytesIO(archive_zip_bytes)) as zf: for info in zf.infolist(): if info.is_dir(): continue rel = info.filename if not rel.startswith(prefix): continue rel_path = rel[len(prefix):] if not rel_path: continue incoming[rel_path] = zf.read(info.filename) added, modified, unchanged = [], [], [] for rel_path, new_bytes in sorted(incoming.items()): dest = repo_root / rel_path if not dest.exists(): added.append(rel_path) else: try: old_bytes = dest.read_bytes() except IOError: old_bytes = b"" if old_bytes != new_bytes: modified.append(rel_path) else: unchanged.append(rel_path) if dry_run: return ...[truncated 3749 chars]- Remediation
View remediation
