T09 · Insecure Skill Coding Practices
- Location
SKILL.md:96- Finding
Persistent Storage of Unredacted Session-Derived Data
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 96-108, 137-145, and 196-198
Vulnerability Type: Persistent plaintext storage of potentially sensitive session data
Risk Level: MediumVulnerable Code
markdown ```json { "schema_version": "session-capture/1", "session_id": "2026-04-14-abc12345", "timestamp": "2026-04-14T10:23:00Z", "source": "friction-detector", "payload": { "signal_type": "retry_loop", "description": "rg command failed 3x, fell back to grep", "context": "searching for pattern in node_modules", "weight": "medium" } }text ```markdown ### Step 4: Propose Graduations Tier 2 crossing: append to LEARNINGS.md friction section. Tier 3 crossing: present proposal with evidence to user, wait for explicit approval before any modification. ### Step 5: Store Results Write session log to `~/.claude/friction/sessions/{date}-{session_id}.json` and update `~/.claude/friction/index.json`.markdown **Consumes from**: session transcripts, `aggregate_learnings_daily` hook data, and the performance tracker for trend correlation.Technical Analysis
The skill directs the agent to consume session transcripts and preserve signal descriptions and contextual text in JSON files under the user's home directory. Recurring transcript-derived patterns may also be appended automatically to the persistent
~/.claude/skills/LEARNINGS.mdfile.Session transcripts can contain credentials, private filesystem paths, proprietary source fragments, personal information, or other confidential user content. The instructions do not require secret detection, contextual redaction, data minimization, owner-only file permissions, or user consent before transcript-derived content is written. Although the document states elsewhere that session files have a 30-day retention period, the reviewed artifact contains no implementation that enfor ...[truncated 2064 chars]
- Remediation
View remediation
Remediation Suggestions
- Store only structured signal identifiers, timestamps, numeric counts, and sanitized command categories. Do not retain raw transcript excerpts, tool output, prompts, secrets, or arbitrary contextual text.
- Apply secret and personal-data detection before persistence. Redact tokens, passwords, authorization headers, private keys, environment values, private paths, email addresses, and source fragments.
- Require explicit user consent before processing transcripts or writing transcript-derived material to persistent storage.
- Require review and approval for Tier 2
LEARNINGS.mdupdates, not only Tier 3 changes toCLAUDE.md. - Create directories with mode
0700and files with mode0600, and reject symlinks or unexpected file types before writing. - Write files atomically using securely created temporary files in the destination directory, then rename them into place.
- Implement and test the documented 30-day deletion policy rather than relying on a declarative retention statement.
- Validate proposed learning entries against trusted evidence and prevent arbitrary transcript content from becoming agent instructions.
- Provide controls that let users inspect, delete, disable, or shorten retention of captured data.
- Document exactly which transcript fields are processed, how similarity is calculated, and which components subsequently consume the stored information.
