Back to skill

Security audit

Ctxkeeper

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local logging tool that persistently stores user-provided context, but its purpose and retention controls are not clear enough for sensitive conversation data.

Review before installing. Use this only for non-sensitive local notes, not secrets, tokens, customer data, or private conversation transcripts. The publisher should align the description with the actual logging behavior, add real prune/delete controls, and enforce private permissions on the data directory and log files.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:6
Finding

Sensitive context logs are created without enforced restrictive permissions

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh:6-9; representative log writes occur at scripts/script.sh:131-300
Vulnerability Type: Insecure storage permissions for potentially sensitive context data
Risk Level: Medium

Vulnerable Code

bash
DATA_DIR="${HOME}/.local/share/ctxkeeper"
mkdir -p "$DATA_DIR"

_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }

Representative category-specific storage follows this pattern:

bash
echo "$ts|$input" >> "$DATA_DIR/run.log"
_log "run" "$input"

Technical Analysis

The Skill stores user-provided conversation and operational context under ~/.local/share/ctxkeeper, but it does not establish a restrictive umask or explicitly set permissions on the directory and log files.

File and directory permissions therefore depend on the invoking process's environment. With a common umask of 022, the directory can be created with mode 0755 and log files with mode 0644. If the user's home directory permits traversal, other local users may be able to read the retained context.

Each submitted entry is written both to a category-specific log and to history.log, increasing the number of copies containing potentially sensitive information. The Skill does not warn users against storing credentials, access tokens, private conversation content, internal hostnames, deployment details, or other confidential operational data.

Attack Path

  1. A user invokes a recording command and supplies sensitive information, such as ctxkeeper run "deployed with token ...".
  2. The script creates the data directory and log files using permissions inherited from the current umask.
  3. The submitted content is written to a category-specific log and duplicated in history.log.
  4. On a shared system where the home directory is traversable, another local account enumerates or directly reads ~/.local/share/ctxkeeper/*.log. 5 ...[truncated 959 chars]
Remediation
View remediation

Remediation Suggestions

Enforce private permissions before creating any data files:

bash
umask 077

DATA_DIR="${HOME}/.local/share/ctxkeeper"
install -d -m 700 "$DATA_DIR"

touch "$DATA_DIR/history.log"
chmod 600 "$DATA_DIR/history.log"

Apply restrictive permissions to existing logs during startup or migration:

bash
find "$DATA_DIR" -maxdepth 1 -type f -name '*.log' -exec chmod 600 {} +
chmod 700 "$DATA_DIR"

Additional hardening should include:

  • Documenting that credentials and secrets must not be recorded.
  • Avoiding unnecessary duplication of sensitive entries in history.log.
  • Providing pruning and secure deletion controls.
  • Considering encryption at rest when the logs may contain confidential context.
  • Verifying ownership of the data directory before writing to it.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill’s declared purpose is managing conversation context with save/load/prune behavior, but the documented functionality is a generic persistent logging toolkit. This mismatch is dangerous because users or orchestrators may invoke it expecting bounded context management while it instead writes broad operational data to disk, creating unexpected retention and possible leakage of sensitive prompts, outputs, or workflow details.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest advertises conversation-context preservation tools, but the body documents category-based logging, search, stats, and export. In an agent ecosystem, this semantic mismatch can cause overbroad invocation and sensitive data capture under false pretenses, especially if the agent passes conversational content to a tool it believes is only managing context state.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest says this skill manages conversation context with saving, loading, and pruning tools, but the exposed commands are generic actions like run, check, convert, analyze, generate, batch, compare, config, and report. There is no implementation of loading sessions or pruning old history; instead the script mainly records arbitrary inputs into separate log files under a local data directory.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Internal contradictions about purpose reduce operator and model ability to use the skill safely. When a skill claims context management but describes operational journaling, users may disclose more information than intended, assuming ephemeral session handling rather than durable logging.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger description is broad and lacks clear boundaries, making accidental or excessive invocation more likely. In context of a persistence-capable tool, vague triggers increase the chance that routine conversational content or sensitive workflow details get logged when a narrower tool should have been used.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation does not adequately warn that commands persist input to local storage under ~/.local/share/ctxkeeper/. This is dangerous because users may provide secrets, customer data, or internal operational details believing they are using a context helper, unaware that the data will be durably logged and later searchable or exportable.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help output documents 'export ' with supported formats json/csv/txt, implying a real data export capability. However, the case statement defines an earlier 'export' branch that just appends user input to export.log, making the later 'export) shift; _export "$@"' branch unreachable and contradicting the documented behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The help text says 'status' performs a health check, which matches the _status function later in the file. But the case statement's first 'status' branch records input to status.log, and because case matching stops at the first match, the later 'status) _status ;;' handler is unreachable, so the documented health-check behavior does not occur.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

These helper functions enumerate and export all .log files in the tool's data directory, search across them, and report recent activity. That behavior is broader than the manifest's narrow purpose of preserving and loading conversation context, and reflects a general-purpose local datastore inspector rather than a context keeper focused on session state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The export feature aggregates previously logged content into new files on disk, multiplying the number of local copies of potentially sensitive data without warning. Because this skill presents itself as managing conversation context, exported data may contain extensive transcripts or confidential prompts, increasing the blast radius of local compromise or accidental sharing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script persistently stores arbitrary user-provided input under ~/.local/share/ctxkeeper in multiple log files and history.log with no consent, minimization, retention control, or redaction. In the context of a conversation-context skill, users are likely to pass prompts, secrets, tokens, internal notes, or personal data, so silent disk persistence materially increases privacy and credential exposure risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.