T02 · Agent Memory Poisoning
- Location
scripts/judgment_tracker.py:69- Finding
Automatic Import of Attacker-Controlled Temporary Files into Persistent Judgment State
- Content
View full analysis
0: return # 已有数据,不重复迁移 migrated = 0 for fname in sorted(os.listdir(tracker_dir)): if not fname.endswith(".ndjson"): continue fpath = os.path.join(tracker_dir, fname) with open(fpath, "r") as f: for line in f: line = line.strip() if not line: continue try: rec = json.loads(line) except json.JSONDecodeError: continue assertion = rec.get("judgment", "") domain = rec.get("topic", "") confidence = rec.get("confidence", "T3") fail_condition = rec.get("fail_condition", "") created_raw = rec.get("created_at", "") created_at = _parse_time(created_raw) check_date_str = rec.get("check_date", "") next_check_at = _parse_time(check_date_str) if check_date_str else (datetime.now(TZ) + timedelta(days=7)) reviewed = rec.get("reviewed", False) status = "supervision" if rec.get("review_result") == "stable" else ("archived" if reviewed else "active") conn.execute(""" INSERT INTO judgment_tracker (assertion, domain, confidence, fail_condition, created_at, next_check_at, status, verifications_passed) ...[truncated 2865 chars]- Remediation
View remediation
