Back to skill

Security audit

session

Security checks for vulnerabilities and agentic risk

Overview

This session-management skill is not malicious, but it needs Review because it can persist hooks, expose session transcripts and metadata to other agents or RAG stores, and mutate or delete session history with uneven consent and scoping.

Install only if you are comfortable giving the skill access to local Claude and Antigravity session stores and allowing it to rewrite, move, archive, or delete session history. Before enabling hooks or RAG/Serena features, verify the destination, use dry-run paths, pin the MCP dependency where possible, and avoid forwarding transcripts that may contain secrets or private project data.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
import.md:48
Finding
Session transcripts are delegated without enforced consent, redaction, or destination validation<![CDATA[ ## Vulnerability Details **File Location**: `import.md:48-85`, with the advisory-only warning at `import.md:97-100` **Vulnerability Type**: Sensitive-data exposure across an agent or provider boundary **Risk Level**: Medium ### Vulnerable Code ```text Task tool: subagent_type: "hookify:conversation-analyzer" prompt: | Find patterns to prevent from the following conversation and generate hooks: <conversation> {fetched session conversation content} </conversation> ``` ```text Task tool: subagent_type: "general-purpose" prompt: | Please analyze the following conversation: <conversation> {session data} </conversation> ``` ```text Task tool: subagent_type: "{specified agent}" prompt: | Please work based on the following session context: <session_context> {fetched session data} </session_context> Request: {user's additional request} ``` The only documented protection is advisory: ```text - Sensitive information should be reviewed manually before import (API keys, tokens, etc.) - Due to context limits, only the most recent 50 messages are delivered ``` ### Technical Analysis The import workflow embeds session contents directly in a Task request sent to a built-in or user-selected agent. Session transcripts can contain source code, credentials, API tokens, private prompts, filesystem paths, personal data, and sensitive tool output. The workflow does not enforce: - A preview of the exact content that will be transmitted. - Explicit confirmation before crossing the agent or provider boundary. - Automated secret detection or redaction. - An allowlist or trust check for the selected agent. - A clear untrusted-data boundary around transcript contents. - Instructions telling the receiving agent not to execute directives contained in the transcript. The warning to review sensitive information manually does not create a technical control. Limiting delivery to 50 messages reduces volume but ...[truncated 1718 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add a mandatory preview that displays the exact messages and destination before delegation. 2. Require explicit user confirmation for every external or differently trusted agent destination. 3. Scan for common credential formats, private keys, bearer tokens, connection strings, and high-entropy secrets. 4. Redact detected secrets by default and require a separate explicit override to include them. 5. Maintain an allowlist of trusted agent targets; require additional approval for arbitrary targets. 6. Wrap transcript content in a clearly marked untrusted-data section and instruct the receiver not to follow commands found inside it. 7. Minimize transferred content by selecting only messages relevant to the stated task rather than automatically sending the latest 50. 8. Document whether each supported destination is local, remote, or handled by a third-party provider. 9. Record the destination, selected message range, and redaction result in an audit log without recording the sensitive content itself. ]]>

T08 · Insecure Dependencies

Warning
Location
compress.md:7
Finding
Unpinned third-party MCP package may be downloaded and executed through npx<![CDATA[ ## Vulnerability Details **File Location**: `compress.md:7-12` and `compress.md:101-103`; related registration instructions also appear at `import.md:23-28` **Vulnerability Type**: Unpinned executable dependency and supply-chain exposure **Risk Level**: Medium ### Vulnerable Code ```text ### 1. Check MCP Tool Availability Check whether the `mcp__claude-sessions-mcp__compress_session` tool is directly available (`ToolSearch("select:mcp__claude-sessions-mcp__compress_session")` or an equivalent tool-list check). - **Available**: Proceed to step 2 - **Not available**: Register `claude-sessions-mcp` in the project's MCP config (`.mcp.json` or `~/.claude/settings.json` `mcpServers`) per `mcp-config` skill conventions, then retry the availability check ``` ```text ## Notes - Compression is irreversible, so backup important sessions - claude-sessions-mcp runs via npx, no separate installation required ``` The import workflow similarly instructs: ```text Check whether `mcp__claude-sessions-mcp__list_projects` is directly available (`ToolSearch("select:mcp__claude-sessions-mcp__list_projects")` or an equivalent tool-list check). If not available, register `claude-sessions-mcp` in the project's MCP config per `mcp-config` skill conventions, then retry the availability check before proceeding. ``` ### Technical Analysis The Skill instructs the agent to register and execute `claude-sessions-mcp` through `npx`, but it does not specify an exact reviewed version, integrity hash, package-lock entry, canonical publisher identity, or immutable source reference. An unversioned `npx` dependency can resolve to a newer mutable release at execution time. Consequently, the effective code executed after the audit can differ from the code that was reviewed. This creates a supply-chain boundary around a component that is expected to enumerate, read, analyze, and modify session data. No evidence in the audited repository establishes that the package is malicious. The ...[truncated 1414 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `claude-sessions-mcp` to an exact reviewed version rather than allowing an unqualified `npx` resolution. 2. Pin and verify the package integrity hash through a lockfile or equivalent immutable dependency record. 3. Document the canonical registry, package owner, source repository, and expected package signature or checksum. 4. Prefer a preinstalled, reviewed local dependency over automatic runtime retrieval. 5. Require explicit user approval before modifying `.mcp.json` or `~/.claude/settings.json`. 6. Display the exact command, resolved version, registry, and configuration scope before installation. 7. Run the MCP server with the narrowest possible filesystem scope and deny outbound network access unless required. 8. Avoid passing environment variables containing unrelated credentials to the MCP process. 9. Re-audit dependency changes before upgrading the pinned version. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/destroy-session.sh:24
Finding
Destroy operation can remove the wrong session because it selects the newest file by modification time<![CDATA[ ## Vulnerability Details **File Location**: `scripts/destroy-session.sh:24-45`; inconsistent recovery documentation appears at `destroy.md:9-12` and `destroy.md:36-45` **Vulnerability Type**: Unsafe destructive target selection and inconsistent backup location **Risk Level**: Medium ### Vulnerable Code ```bash # Find the most recently modified session file LATEST_SESSION=$(ls -t "$SESSION_DIR"/*.jsonl 2>/dev/null | head -1) if [ -z "$LATEST_SESSION" ]; then echo "No session files found." exit 1 fi SESSION_ID=$(basename "$LATEST_SESSION" .jsonl) BAK_FILENAME="${PROJECT_FOLDER}_${SESSION_ID}.jsonl" echo "Deleting session..." echo " source: $LATEST_SESSION" echo " backup: $BAK_DIR/$BAK_FILENAME" # Move session file to backup directory mv "$LATEST_SESSION" "$BAK_DIR/$BAK_FILENAME" ``` The backup path is initialized as: ```bash CLAUDE_DIR="$HOME/.claude" BAK_DIR="$CLAUDE_DIR/.bak" PROJECTS_DIR="$CLAUDE_DIR/projects" ``` However, the documentation states: ```text 1. Moves the current session file to `~/.claude/projects/.bak/` as a backup ``` and provides recovery commands using: ```bash ls ~/.claude/projects/.bak/ mv ~/.claude/projects/.bak/{backup_file}.jsonl ~/.claude/projects/{project_name}/{session_id}.jsonl ``` ### Technical Analysis The operation is described as deleting the currently active session, but the script does not identify that session using a validated session UUID. Instead, it assumes that the most recently modified JSONL file belongs to the invoking session. Modification time is not a reliable identity mechanism. Another IDE window, a background hook, synchronization software, session compaction, or another active agent can update a different session immediately before this script executes. The script will then move that unrelated file. The operation is recoverable in principle because it moves rather than permanently deletes the file. However, the implementation writes to `~/.claude/.bak/`, while the documentatio ...[truncated 1613 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require the exact current session UUID from a trusted hook input or explicit command-line argument. 2. Validate the UUID format and verify that the resolved file belongs to the expected project. 3. Fail closed when the current session ID cannot be determined; do not fall back to modification time. 4. Display the UUID, source path, size, and destination, then require explicit confirmation before moving the file. 5. Use a single documented backup location, preferably `~/.claude/projects/.bak/`, consistently across code and documentation. 6. Refuse to overwrite an existing backup; use a unique timestamped name or require manual resolution. 7. Verify the destination after the move and print an exact tested recovery command. 8. Restart the Extension Host only after successful target verification and only with separate user approval. 9. Add tests covering concurrent sessions, misleading modification times, existing backups, path consistency, and missing session IDs. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (33)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill advertises and documents file reads, file writes, shell execution, and environment-dependent behavior, but does not declare permissions. That creates a transparency and governance gap: callers cannot reliably assess or constrain what the skill may do before invoking destructive or system-touching operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
The documented scope understates several sensitive behaviors, including hook-based prompt/context injection, restart behavior, and session-content extraction. Hidden or under-disclosed behaviors are dangerous because they can alter prompts, expose metadata, or trigger disruptive actions without users understanding the full trust boundary of the skill.

Context-Inappropriate Capability

Low
Confidence
85% confidence
Finding
The skill can persist extracted project knowledge to Serena memory, which creates a durable copy of potentially sensitive repository context outside the session-analysis path. Because this persistence is not strictly necessary for analysis, it increases the chance of unintended retention or cross-context exposure of project data.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The skill claims to find the current conversation's session ID, but these instructions add procedures for enumerating Orca terminals and resolving external Claude sessions. That expands scope from self-inspection to cross-session discovery and could expose identifiers and activity metadata for unrelated running sessions, enabling unauthorized correlation or targeting.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
The documentation frames the capability as limited to the current conversation, but later content instructs the agent to identify other Claude sessions in external terminals. This mismatch is dangerous because it obscures a broader surveillance capability from users and reviewers, increasing the chance of unintended or unauthorized use.

Intent-Code Divergence

High
Confidence
97% confidence
Finding
The detection query suggests fixing broken chains by assigning parentUuid from the previous file-order message, which directly contradicts the later invariant that file order does not equal chain order. If followed, this can silently relink unrelated conversation branches, corrupt session history, and expand active context across compact boundaries, causing integrity loss and potentially exposing prior hidden context to later processing.

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The manual broken-chain repair code rewrites missing parentUuid values to the immediately previous line's uuid, despite the document explicitly warning that this force-linearizes unrelated branches. That can materially alter session semantics, merge histories across compact or sidechain boundaries, and create confidentiality and integrity issues by making unrelated prior content part of the active chain.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill documents a destroy operation that deletes the current session and restarts the IDE/extension host, but this file lacks a prominent confirmation or safety warning. In a session-management skill, that is especially risky because users may invoke it expecting routine maintenance and instead lose conversation state or trigger an unexpected reset.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The purge topic describes permanent deletion of sessions, including broad scopes like current project or all projects, without a prominent warning in the main skill file. Because this skill operates over session stores and supports shell/file actions, an unclear purge path can lead to irreversible data loss at scale.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The --sync workflow extracts project knowledge and writes it to persistent Serena memory without a clear user-facing warning at execution time that project-derived data will be stored. This can lead to inadvertent disclosure or retention of sensitive internal details, especially if users interpret analyze as a read-only reporting action.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs the caller to automatically dispatch archived session content to an external RAG receiver based on workspace configuration or an override flag, but it does not require an explicit user confirmation or a clear warning that sensitive transcript data may leave the local session store. Because session archives can contain secrets, credentials, internal discussions, or personal data, this can cause unintended exfiltration to third-party indexing systems even when the user only asked to archive locally.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill instructs storing distilled session knowledge to a RAG receiver but does not require an explicit user warning or confirmation that session-derived data may be transmitted to an external system. Because sessions can contain sensitive project details, credentials, internal decisions, or customer data, this creates a meaningful privacy and data-governance risk even if the feature is intended for helpful knowledge retention.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The Serena memory write flow persists extracted session knowledge outside the original session context, but the instructions do not tell the operator to warn the user or obtain confirmation first. This can unexpectedly retain sensitive or proprietary content in a secondary knowledge store, increasing exposure and violating user expectations about session-local data handling.

Vague Triggers

Medium
Confidence
88% confidence
Finding
Triggering hook behavior on bare words like 'qdrant', 'rag', or 'session' is overly broad and can activate session-ID logic in many unrelated prompts. In a session-management skill, that increases the chance of unintended metadata injection or execution paths that expose internal identifiers and transcript locations without a user's deliberate request.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill explicitly instructs forwarding session data to other agents/skills via a pipeline, but it does not require a clear user confirmation or a strong privacy warning before transfer. Session content commonly contains sensitive prompts, credentials, internal code, or personal data, so relaying it to another agent increases exposure and can violate least-privilege expectations.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The migration steps direct users to copy SQLite databases and brain artifacts and to upsert session summaries into an index without safeguards around overwrite, corruption, or consistency. Direct manipulation of session stores can damage integrity, create stale or conflicting metadata, or accidentally overwrite another session if identifiers or paths are wrong.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The installation instructions explicitly configure an automatic hook so every session receives its session ID in context, but they provide no privacy notice, scoping guidance, or data-handling limits. Automatically propagating identifiers into all prompts can increase metadata exposure to models, logs, downstream tools, exports, and shared transcripts, especially because this skill is specifically about session management and cross-environment synchronization.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
This is a real safety issue because the skill instructs users to move and permanently delete session JSONL files and related directories, but the destructive step lacks a prominent pre-action warning about data loss, broken references, and the need for backup/verification. In this context, the skill is specifically for session management, so users are likely to trust and execute these commands directly; that makes accidental loss or corruption of session history more likely even without malicious intent.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
The manual fallback encourages direct jq/Python rewrites of session files and shows inline replacement flows without an immediate, prominent warning about destructive outcomes if commands are misapplied. In this context, users are editing persistent session state, so incomplete warnings increase the likelihood of accidental data loss or corruption of conversation records.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The invalid-surrogate repair guidance recommends dropping broken lines, which permanently removes session content, but the local instructions do not foreground that this is irreversible data loss. In a session-repair skill, operators may run such commands during incident response, so under-warning this behavior can destroy evidence or needed conversation history.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The orphan-tool-result deletion instructions tell users to delete lines in place, which is a destructive content-removal operation, without a nearby explicit warning about loss of conversation data and possible downstream chain effects. Because session files are the source of truth for historical state, this creates a meaningful integrity risk if users follow the commands mechanically.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The hook automatically injects the current session ID, transcript path, and sometimes model information into model context without explicit user disclosure or opt-in. That expands the model's access to local metadata and can expose sensitive filesystem layout or identifiers to downstream prompts, plugins, logs, or prompt-injection chains that would not otherwise have that context.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The SessionStart branch automatically injects the current session UUID and transcript path into model context without any per-request user action or visible warning. Even though these values are not secrets in the traditional sense, they are sensitive internal metadata that can be exfiltrated by prompt-injection or misused by downstream skills to access, modify, or correlate session artifacts the user did not explicitly intend to expose at that moment.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The manual SQLite fallback provides destructive DELETE statements against session history and modifies summary metadata, but the warning language does not clearly emphasize that this operation is irreversible from the primary data source if backups are not restored correctly. In a session-management skill, users are likely to follow these instructions directly, so insufficient data-loss warning increases the chance of accidental destruction of conversation records.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script prints session-derived titles and recent user messages directly to stdout, which can expose sensitive content from local session histories to terminals, logs, scrollback, shell history pipelines, or downstream tooling. In a session-management skill, that risk is heightened because the data source is likely to contain prompts, secrets, internal URLs, or other private user context.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/batch-compress.py:28

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/repair-session.py:21

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/test-repair-compact-boundary.py:28