T03 · Remote Payload Retrieval and Execution
- Location
scripts/v2_check_executor.py:8- Finding
Remote benchmark bundles can execute unauthenticated Python evaluator code
- Content
View full analysis
tuple[Path, dict]: session = config.get("task_session") or {} session_id = session.get("session_id") ticket = session.get("ticket") if not session_id or not ticket: raise RuntimeError("missing v2 task session credentials for remote bundle download") params = urllib.parse.urlencode( { "lang": config.get("lang", "zh"), "session_id": session_id, "version": bundle_version, } ) request = urllib.request.Request( f"{config['api_base'].rstrip('/')}/api/v2/bundle?{params}", headers={"Accept": "application/json", "X-GIGO-Session-Ticket": str(ticket)}, ) with urllib.request.urlopen(request, timeout=30) as response: archive = json.loads(response.read().decode("utf-8")) if str(archive.get("bundle_version")) != bundle_version: raise RuntimeError("remote v2 bundle version does not match the active session") if bundle_hash and str(archive.get("bundle_hash")) != bundle_hash: raise RuntimeError("remote v2 bundle hash does not match the active session") ``` ```python def run_check(task: Task, workdir: Path, transcript: dict) -> dict: task_dir = Path(task.task_dir) spec = importlib.util.spec_from_file_location(f"gigo_check_{task.id}", task_dir / "check.py") module = importlib.util.module_from_spec(spec) assert spec.loader is not None spec.loader.exec_module(module) fixtures = task_dir / "fixtures" return module.evaluate(workdir, transcript, fixtures) ``` ### Technical Analysis The Skill downloads a task archive from the configured API and later imports ...[truncated 2007 chars]- Remediation
View remediation
