Back to skill

Security audit

Session Branch

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed session-handoff helper that writes a project handoff file and uses opt-in IDE memory/profile scans, with no evidence of hidden execution, exfiltration, or destructive behavior.

Install only if you want a project handoff document created. Grant IDE memory/profile/config access narrowly, review the generated handoff before sharing or committing it, and be aware that the default handoff path may overwrite an existing file.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:47
Finding

Overbroad Collection of Environment and IDE Metadata

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:47-64
Vulnerability Type: Excessive access beyond the minimum required for session handoff
Risk Level: Medium

Vulnerable Code Snippet

markdown
**Supplementary context** (not token-budgeted): project identity, platform status, env var names (status only), capability boundary, knowledge file index, user preferences.

#### IDE-Specific Additional Scanning

> **Consent required**: Before scanning any of the following, inform the user what files will be accessed and ask for explicit permission. Skip any category the user declines.

**For WorkBuddy**, also scan (with user consent):
- **Identity files**: `~/.workbuddy/SOUL.md`, `IDENTITY.md`, `USER.md` — persona and preferences
- **Memory files**: `.workbuddy/memory/MEMORY.md` + daily logs — project memory
- **Installed skills**: `~/.workbuddy/skills/` — list of active skills
- **Scheduled tasks**: automation/cron task list and status
- **Channel config**: IMA knowledge base IDs, Feishu channel configuration
- **MCP connectors**: active MCP connector status

**For TRAE SOLO**, also scan (with user consent):
- **Rules**: `.trae/rules/` — project-level rules
- **Schedule**: TRAE SOLO Schedule task list
- **Memory system**: `~/.trae-cn/memory/` — user profile, project memory, recent topics (see `references/memory-guide.md` for path structure)

The declared capability is also confirmed at SKILL.md:145-146:

markdown
| File read/write | Yes | Reads project files; writes `docs/session-handoff.md` (overwrites if exists). Reads IDE memory/identity files (e.g., `~/.trae-cn/memory/`, `~/.workbuddy/SOUL.md`) **ONLY with explicit user consent** — opt-in, never silent reads |
| Environment variables | Yes | Reads env var names (status only, never values) |

Technical Analysis

The Skill's primary function is to summarize the current coding session and create a handoff document. The optional workflow extends beyond project and conversation cont ...[truncated 2689 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove environment-variable enumeration from the default handoff workflow. Collect a variable name only when it is directly referenced by the active task or a project configuration file.
  2. Restrict default scanning to the current conversation and project-relative files needed for the active task.
  3. Split consent into independent, granular prompts for:
    • Identity files
    • Project memory
    • Cross-project memory
    • Installed skills
    • Scheduled tasks
    • Channel configuration
    • MCP connectors
    • Environment metadata
  4. Before each category is accessed, display the exact paths or resources, the fields that will be extracted, and why each item is necessary.
  5. Default every supplementary category to disabled and provide a fully functional handoff when all optional access is declined.
  6. Do not place raw identity, memory, connector, channel, task, or environment metadata in the handoff. Include only a narrowly scoped summary explicitly approved by the user.
  7. Add a final preview and separate confirmation before writing operational metadata to disk.
  8. Prevent accidental disclosure by recommending or automatically adding generated handoff files to an appropriate ignore mechanism, subject to user approval.
  9. Refuse to overwrite an existing handoff file without explicit overwrite confirmation or create a versioned backup.
  10. Add automated validation that rejects absolute personal paths, connector identifiers, channel IDs, internal addresses, environment values, credentials, and unrelated cross-project content.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/startup-prompts.md (reported line 190)May include surrounding context.

md
5. If a memory system exists, add explicit "read memory files **with user consent (OPT-IN)**" instructions to Step 1 — never silently read identity/memory files; always ask the user first and provide a clear "decline is fine" alternative
6. When reporting recovered memory context, limit to project conventions and recent topics — do NOT report detailed personal preferences (language, security sensitivity, work style details); only acknowledge "memory context recovered"
7. Determine the handoff document save location (project docs/ vs IDE-specific directory)
8. Add the new template to this file and update SKILL.md's `target_ide` config

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README says to invoke the skill by saying "支线任务" / "开个支线" / "分叉", but it does not define the context in which these phrases should trigger or provide negative examples. Terms like "分叉" and "开个支线" are conversationally broad enough to risk unintended activation in ordinary discussion about branching work.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

md
**Before executing any step, the agent MUST:**

1. **Warn the user** that this skill will write a file to the project directory (e.g., `docs/session-handoff.md`)
2. **Ask for explicit consent** before scanning any IDE-specific identity, memory, or configuration files
3. **Never harvest env var values** — only record variable names and whether they are configured (yes/no)
4. **Use project-relative paths** in all generated documents — never absolute paths containing usernames or home directories

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The line explicitly instructs 'Use Chinese prompts' as a fixed behavior for the WorkBuddy adaptation. This is a natural-language locale policy issue because it imposes a language choice without stating that the user can choose or opt in to that language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This guidance ties prompt language to the IDE category rather than the user's expressed preference. That can create an organizational language/locale policy violation by forcing a locale based on environment instead of offering a choice.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The English section says "In your current conversation, say:" but only lists Chinese phrases, without clarifying whether those are the exclusive triggers or whether other wording may invoke the skill. This leaves the trigger scope ambiguous for English-speaking users and makes activation behavior less predictable.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide states that Markdown files must be in English and that README.md must follow a fixed bilingual ordering. This is a natural-language policy constraint that forces language/locale behavior without presenting contributor choice or documenting a region-specific need.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

These lines require Markdown files to be in English and README.md to be bilingual in a prescribed order. This enforces a specific language policy in natural-language instructions without offering an opt-in or explaining why the locale constraint is necessary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The template instructs use of ~/.trae-cn/... paths for TRAE memory files, which embeds a specific locale/variant in the guidance. Because the document does not present this as an optional locale-specific example or offer alternatives, it can violate the policy against forcing a specific language/locale without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.