T09 · Insecure Skill Coding Practices
- Location
SKILL.md:52- Finding
Insufficient Protection Against Disclosure of Sensitive Session Data
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 52-81 and 103-108
Vulnerability Type: Sensitive information exposure through session discovery, parsing, and replay generation
Risk Level: MediumComplete Code Snippet
markdown ### Step 0: Pick a Session (when no path is provided) When the user invokes `/session-replay` without a path argument, use `scribe.session_parser.list_sessions()` to discover recent session files from `~/.claude/projects/`. The function returns a list of `SessionInfo` objects sorted by modification time (most recent first), each containing: - `path` -- full path to the .jsonl file - `modified` -- mtime timestamp - `first_user_message` -- preview of the first human message - `turn_count` -- number of user turns in the session - `project_name` -- parent directory name Present the list to the user as a numbered menu:Recent sessions:
- [my-project] "implement auth module" (8 turns, 2h ago)
- [api-server] "fix rate limiting bug" (3 turns, 5h ago)
- [docs-site] "update installation guide" (12 turns, 1d ago)
text Ask the user to pick a number. Use the selected session's `path` for the remaining steps. If `list_sessions` returns an empty list, report that no sessions were found and suggest providing a path directly. ### Step 1: Parse the Session Use `scribe.session_parser.parse_session()` to read the JSONL file. The parser: - Extracts user and assistant turns - Skips sidechain (subagent) records - Collapses tool calls into readable summaries - Wraps text at the configured column width - Truncates long responses at the configured row count Apply filters based on user options: - `--turns` selects specific turn ranges (e.g. `1-5`) - `--show` controls which layers appear: `user`, `assistant`, `tools`, `thinking` (thinking is excluded by default)markdown ### Step 3: Render GIF Invoke `Skill(scry:vhs-recor ...[truncated 2947 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit user approval before enumerating
~/.claude/projects/, and avoid displaying message previews unless separately authorized. - Require explicit selection of a session file rather than automatically discovering session history, or constrain discovery to a user-approved project directory.
- Keep
toolsandthinkingdisabled by default. Display a prominent warning and obtain separate confirmation before including either layer. - Add a pre-render review showing exactly which turns and layers will appear in the GIF.
- Scan extracted content for common secret formats, including API keys, access tokens, private keys, passwords, authorization headers, connection strings, and sensitive environment variables.
- Redact detected secrets and allow users to define additional project-specific redaction patterns.
- Require confirmation immediately before rendering, including the destination path and a warning that GIF contents may be publicly shareable and difficult to revoke.
- Create temporary files with restrictive permissions, unpredictable names, and exclusive creation semantics. Delete them on both success and failure.
- Validate and normalize user-provided input and output paths, and reject destinations outside user-approved directories where appropriate.
- Document that deletion of the temporary tape does not sanitize the generated GIF and advise users to inspect the final artifact before distribution.
- Require explicit user approval before enumerating
