T09 · Insecure Skill Coding Practices
- Location
distill.py:421- Finding
Unredacted credentials and personal data are persisted in plaintext
- Content
View full analysis
list[dict]: """Extract specific, concrete facts.""" facts = [] seen = set() for section in sections: body = section["body"] header = section["header"] for line in body.splitlines(): line = line.strip() if len(line) < 15 or len(line) > 400: continue if any(re.search(p, line) for p in FACT_PATTERNS): key = line[:50] if key in seen: continue seen.add(key) # Strip markdown formatting clean = re.sub(r"\*{1,2}(.+?)\*{1,2}", r"\1", line) clean = re.sub(r"`(.+?)`", r"\1", clean) facts.append({ "fact": clean[:400], "domain": detect_domain(line + " " + header), "tags": extract_tags(line) }) return facts[:20] ``` The extracted values are subsequently written without redaction: ```python experience = { "id": exp_id, "source": relative, "source_date": source_date, "distilled_at": datetime.now().isoformat(), "hash": h, **extracted } EXP_DIR.mkdir(parents=True, exist_ok=True) exp_path = EXP_DIR / f"{exp_id}.json" exp_path.write_text(json.dumps(experience, indent=2)) ``` The package contains records matching live credential formats, including an API key identifier, an API secret, a service key, credential file paths, and an email address. The credential values are intentionally not reproduced in this report. ### Technical Analysis The `FACT_ ...[truncated 1939 chars]- Remediation
View remediation
