T09 · Insecure Skill Coding Practices
- Location
scripts/migrate.py:139- Finding
Private and third-party data is bundled into distributable archives
- Content
View full analysis
Vulnerability Details
File Location:
scripts/migrate.py:139-161; affected data includesEXAMPLES/xiaoyi-example/owner.json:3-33,EXAMPLES/xiaoyi-example/memory.json:5-93, andEXAMPLES/xiaoyi-example/relations.json:5-133
Vulnerability Type: Sensitive-data exposure through unsafe archive inclusion
Risk Level: HighVulnerable Code
python include_patterns = [ "README.md", "MIGRATION-GUIDE.md", "CHANGES.md", "manifest.toml", "TEMPLATE/", "EXAMPLES/", "scripts/" ] exclude_files = [] print(f"\nSource directory: {root_dir}") print(f"Output file: {output_name}") with zipfile.ZipFile(output_path, 'w', zipfile.ZIP_DEFLATED) as zipf: for pattern in include_patterns: full_path = root_dir / pattern if full_path.exists(): if full_path.is_file(): arcname = full_path.name zipf.write(full_path, arcname) else: for file_path in full_path.rglob("*"): if file_path.is_file(): arcname = str(file_path.relative_to(root_dir)) if file_path.name not in exclude_files: zipf.write(file_path, arcname)The recursively included example files contain plaintext records marked as private or sensitive, including an owner's name, location, profession, family details, recurring schedule, business strategy, investment positions, third-party email addresses, relationship histories, and communication summaries.
Technical Analysis
The
pack_zip()function uses a fixed inclusion list that contains the entireEXAMPLES/directory. It then recursively archives every regular file becauseexclude_filesis empty. There is no data classification enforcement, redaction, sensitive-data scan, user confirmation, or allowlist of approved example files.This behavior conflicts with the se ...[truncated 1836 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all real personal and third-party information from the repository and replace it with clearly synthetic example data.
- Exclude
EXAMPLES/from production archives by default. - If examples are needed, require an explicit option such as
--include-examples. - Replace recursive directory inclusion with a strict allowlist of files selected for the current migration.
- Add a pre-pack scan for email addresses, phone numbers, credentials, financial positions, schedules, and other personal data.
- Block packaging when private or sensitive files are detected unless the user explicitly reviews and approves each file.
- Display the final archive inventory and sensitivity classification before creating the ZIP.
- Add automated tests confirming that private example files cannot enter default release archives.
- Obtain consent before distributing any third-party contact or relationship information.
