T09 · Insecure Skill Coding Practices
- Location
scripts/recruiting_sync.py:1040- Finding
Sensitive Gmail and recruiting metadata stored in a plaintext state file
- Content
View full analysis
dict[str, Any]: previous_source = previous.get("source", {}) if previous else {} subjects = previous_source.get("subjects", []) thread_ids = previous_source.get("threadIds", []) return { "threadIds": merge_unique(thread_ids, candidate.source_ids), "subject": candidate.source_subjects[-1], "subjects": merge_unique(subjects, candidate.source_subjects), "sender": candidate.source_sender or previous_source.get("sender", ""), "lastSeenAt": candidate.received_at.strftime("%Y-%m-%d %H:%M"), } ``` ```python def write_state(state: dict[str, Any], output: Path) -> None: output.parent.mkdir(parents=True, exist_ok=True) output.write_text(json.dumps(state, ensure_ascii=False, indent=2) + "\n", encoding="utf-8") ``` ### Technical Analysis The synchronization state retains Gmail thread identifiers, original email subjects, sender information, event notes, roles, timestamps, and extracted links. The complete state is serialized as unencrypted JSON. The code does not explicitly create the file with restrictive permissions, verify the permissions of an existing file, or atomically replace it with a securely created temporary file. Consequently, actual access control depends on the process umask and permissions inherited by the configured output directory. This retention also exceeds the minimum data needed for reminder synchronization. Stable hashes or reduced event identifiers could support deduplication without retaining raw sender addresses, complete subjects, and Gmail thread identifiers. It conflicts with the Skill documentation's stated ...[truncated 1569 chars]- Remediation
View remediation
