T09 · Insecure Skill Coding Practices
- Location
SKILL.md:228- Finding
User-Controlled Session Name Interpolated into Executable Python and Shell Syntax
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a real session-name syncing purpose, but its instructions include unsafe local command execution patterns and broad daemon/state changes that require careful review before use.
Install only if you understand that this skill may edit Claude Code and cc-connect session files, restart cc-connect, and affect Feishu message handling. Avoid using arbitrary or untrusted session names with the documented commands, and prefer a safer version that passes names as data, verifies daemon PIDs, backs up state files, and asks explicitly before restart or past_id_tracking changes.
SKILL.md:228User-Controlled Session Name Interpolated into Executable Python and Shell Syntax
SKILL.md:394Overbroad Process Termination and Unverified Lock-File Deletion
SKILL.md:420Session Naming Operation Disables Message Replay-Tracking Control
The command removes a lock file and forcefully kills processes using broad shell matching. This is dangerous because it combines destructive file operations with process management in a way that can be misapplied, target the wrong processes, bypass normal coordination, and damage service state or availability.
One-shot kill + restart (minimize round trips):
# Stop daemon — aggressive single pass
kill $(pgrep -f 'cc-connect') 2>/dev/null; sleep 1; kill -9 $(pgrep -f 'cc-connect') 2>/dev/null; rm -f ~/.cc-connect/.config.toml.lock; sleep 1
# ... make changes to JSON file (include past_id_tracking=False in the same write) ...
The one-line command chains multiple high-impact operations with shell separators, making review, validation, and partial-failure handling difficult. Chained destructive actions increase the chance of unintended side effects and make command injection or misuse more damaging if any interpolated component is ever introduced.
One-shot kill + restart (minimize round trips):
# Stop daemon — aggressive single pass
kill $(pgrep -f 'cc-connect') 2>/dev/null; sleep 1; kill -9 $(pgrep -f 'cc-connect') 2>/dev/null; rm -f ~/.cc-connect/.config.toml.lock; sleep 1
# ... make changes to JSON file (include past_id_tracking=False in the same write) ...
The skill advertises very broad natural-language triggers such as generic mentions of 'session name' and Chinese equivalents, which can overlap with ordinary conversation and cause unintended invocation. In this skill, unintended activation is more concerning because the described behavior synchronizes and writes session-name data across multiple local storage locations, creating a risk of accidental state changes or metadata corruption.
The manifest trigger list includes broad phrases such as "session name", "register sessions", and the Chinese term "会话名", which can appear in ordinary discussion rather than a clear request to invoke the skill. Because the file does not provide exclusion conditions or negative examples in the trigger field, these phrases could cause unintended activation.
The skill persists session metadata across local JSONL and cc-connect JSON stores, creating durable cross-system linkage of session identifiers and names. Persistent writes are security-relevant because they can expose or retain sensitive project/session information longer than expected and create integrity risks if written incorrectly.
Bidirectionally sync session names between Claude Code (CLI + VSCode) and cc-connect (飞书).
Three naming systems → two storage locations:
- **Claude Code CLI `/rename`** and **VSCode** → both read/write JSONL `custom-title` entry
- **cc-connect `/name`** (飞书) → writes own JSON file (`sessions[sN].name` + `session_names[UUID]`)
Keeping these two storage locations consistent = all three naming systems are unified.
The documented register mode performs broad state repair and mutation, including restoring cleared names, resolving mismatches, updating history, and toggling internal flags. This exceeds the narrow user expectation of syncing names and increases the blast radius of any mistake or misuse.
The register flow fabricates synthetic history entries to alter cc-connect state and display behavior, even though the skill's stated purpose is session-name synchronization. Writing invented conversation history can corrupt application state, misrepresent records, and create hard-to-audit side effects unrelated to naming.
Appending custom-title entries directly into session JSONL changes persistent session records without schema or content validation. Because the title originates from user input and is stored durably, malformed or sensitive data could be embedded into session artifacts and later consumed by other tools.
Write custom-title (CLI + VSCode both read this):
python3 -c "
import json, os
The skill explicitly acknowledges and works around persistent daemon-managed state files, indicating it modifies authoritative application storage directly. Direct manipulation of active state files raises integrity and race-condition risks, especially when the daemon may overwrite or partially reconcile changes.
print(f'\nClaude Code only: {uuid[:8]}... = {cc_sessions[uuid]}')
## Daemon Overwrite Problem
**cc-connect daemon periodically writes its internal state to the session JSON file**, overwriting any external modifications. This means:
- Names set externally get cleared
The skill instructs the agent to kill processes, delete a lock file, and restart a daemon as part of a naming workflow. That is a significant expansion of capability beyond simple metadata synchronization and can disrupt running services, drop messages, or affect unrelated cc-connect activity if the process match is broad or the environment differs from assumptions.
Restarting the daemon after persistent state edits operationalizes those edits and can cause message loss during the documented recovery window. This makes the persistence behavior materially riskier because changes are not just stored but enforced through service interruption and reconnection.
# ... make changes to JSON file (include past_id_tracking=False in the same write) ...
# Restart daemon
nohup cc-connect --force > /tmp/cc-connect.log 2>&1 & disown; sleep 3
# ⚠️ WARN USER: Feishu messages will be ignored for ~5 minutes after restart (past_id_tracking bug).
# New messages sent after that window will be processed normally.
The README presents invocation guidance and instructions in English and Chinese and includes Chinese-only trigger phrases, but does not state whether language selection is optional or how users in other locales should interact with the skill. Under the policy, locale or language constraints should be explicitly optional or justified.
The natural-language description centers activation and behavior around Chinese trigger phrases and a Feishu-specific workflow, but it does not explicitly state that this locale/tooling constraint is optional or user-selected. This can be a language/locale policy concern when a skill appears to prefer a specific language or collaboration environment without opt-in.
Detected: suspicious.generated_source_template_injection