Back to skill

Security audit

搭子路书旅行自动化

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Trek travel-sync integration, but it gives agents broad live write access and has an unsafe generic command path that can bypass its own high-risk confirmation model.

Install only if you trust the Trek service and publisher with your live trip data, attachments, and broad Trek account actions. Use a separate revocable Trek Agent Key, revoke it when finished, avoid uploading sensitive local files unless intentional, and be especially cautious with `trek call` because it can invoke destructive server tools without the safer batch confirmation flow.

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/trek-mcp.mjs:521
Finding

Generic Tool Invocation Bypasses High-Risk Operation Confirmation

Content
View full analysis

Vulnerability Details

File Location: scripts/trek-mcp.mjs, lines 521–523 and 568–573
Vulnerability Type: Missing authorization gate for destructive operations
Risk Level: Medium

Vulnerable Code

js
if (command === 'call') {
  if (!args[0] || args.length > 2 || args.some(arg => arg.startsWith('--'))) throw new Error('invalid_arguments: usage: trek call TOOL @args.json');
  parseJsonArg(args[1]);
}
js
if (command === 'call') {
  const [name, jsonArg] = args;
  if (!name) throw new Error('call requires a tool name');
  if (!names.has(name)) throw new Error(`unknown/unavailable tool: ${name}`);
  return print(await client.callTool(name, parseJsonArg(jsonArg)));
}

The batch interface implements a separate safeguard:

js
if (!args.includes('--apply')) return print({ ok: true, dryRun: true, count: actions.length, actions });
const risky = actions.filter((action) => highRisk.test(action.tool)).map((action) => action.tool);
if (risky.length && !args.includes('--confirm-high-risk')) throw new Error(`high-risk tools require --confirm-high-risk: ${[...new Set(risky)].join(', ')}`);

Technical Analysis

The generic trek call command accepts any tool returned by the remote MCP server’s tools/list response. Its only authorization check is whether the requested tool name appears in that server-provided list. It does not apply the highRisk classification, require --confirm-high-risk, or provide a dry-run stage.

Consequently, destructive tools such as delete_trip, as well as other server-listed tools whose names represent removal, decision, scheduling, settlement, restoration, or credential rotation, can be invoked directly through trek call. This bypasses the safeguards enforced by the batch command and the preview requirement documented in the Skill workflow.

The MCP server may still enforce account permissions, so this does not grant access beyond the configured Trek key. However, the configured key is documente ...[truncated 1771 chars]

Remediation
View remediation

Remediation Suggestions

  1. Apply the high-risk operation check to the call command before invoking client.callTool():

    • Classify the requested tool using the same policy as batch execution.
    • Reject high-risk tools unless an explicit confirmation option is present.
    • Require a distinct apply flag or confirmation artifact so merely constructing a command cannot execute the mutation.
  2. Prefer a strict, centrally maintained policy over name matching:

    • Use trusted server metadata that identifies read-only, mutating, destructive, financial, membership, and credential-management tools.
    • If such metadata is unavailable, maintain a local allowlist of read-only tools and treat unknown mutating tools as high risk by default.
  3. Enforce the confirmation boundary in executable code rather than relying solely on instructions in SKILL.md.

  4. For destructive operations, display a structured preview containing the tool name, target trip or resource identifier, and affected action before execution.

  5. Require post-operation readback and clearly report partial or uncertain outcomes.

  6. Add regression tests proving that:

    • trek call delete_trip ... is rejected without explicit confirmation.
    • Other classified high-risk tools are similarly rejected.
    • Read-only calls continue to work without unnecessary confirmation.
    • Newly exposed or unknown mutating tools fail closed.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (27)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/trek-cli.test.mjs (reported line 24)May include surrounding context.

js
return spawnSync(process.execPath, [cli, ...args], {
    cwd: resolve('.'),
    encoding: 'utf8',
    env: { ...process.env, TREK_MCP_TOKEN: '', MCP_API_TOKEN: '', ...env },
  });
}

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The README instructs users to install code directly from a live GitHub branch archive and configure the agent to send a bearer key to an external MCP endpoint. Even if legitimate, this creates a supply-chain and data-transmission risk because mutable remote code and a third-party service are trusted with itinerary data and authentication material.

Content

Scanner excerpt · README.md (reported line 81)May include surrounding context.

bash
npm install -g https://github.com/super21-bat/trek-agent-control/archive/refs/heads/main.tar.gz
trek config init --api-key '由用户单独提供' --url 'https://api.superd.fun/mcp'
trek skill sync --global
trek doctor

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This section directs agents to authenticate to an external MCP service using a user-provided bearer key, which necessarily transmits sensitive trip data and credentials outside the local environment. In the context of an agent skill that can read and modify itineraries, this external transmission is security-relevant because compromise or misuse of the service could expose or alter user travel information.

Content

Scanner excerpt · README.md (reported line 95)May include surrounding context.

原生 MCP 配置:

text
URL: https://api.superd.fun/mcp
Authorization: Bearer <用户自己的 Trek Agent Key>

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation entry for SKILL.md states it contains rules the agent 'must follow,' and the skill branding and surrounding instructions are entirely Chinese-focused. In this context, the skill appears to impose a specific language/locale behavior without any explicit user opt-in or alternative language option, which can violate language-choice policy.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill describes powerful capabilities—MCP access, network access, shell commands, package installation, and handling user secrets—but does not declare any explicit tool scope or allowed-tools boundary. That omission increases the chance an agent will execute broader-than-necessary actions, expose credentials, or perform unintended writes because there is no machine-readable least-privilege constraint.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

This section instructs the agent to transmit a bearer credential (trek_ key) to a remote third-party endpoint. Even though the text warns to treat the key as secret, the core behavior is still external credential transmission and remote access to real user data, so compromise of the endpoint, interception, misconfiguration, or over-broad key scope could expose or modify sensitive travel information.

Content

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

md
1. Never paste the `trek_` key into files, prompts, logs, screenshots, commits, or shell history intended for sharing.
2. Prefer the agent's native Streamable HTTP MCP support. Configure:
   - URL: `https://api.superd.fun/mcp`
   - Header: `Authorization: Bearer <user-key>`
3. Use the Trek CLI to install/sync this Skill, verify the connection, and diagnose failures:

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The skill directs the agent to install code directly from a remote GitHub archive and then configure it with a sensitive API key for a remote service. This combines supply-chain risk with credential use: a tampered package, mutable branch archive, or malicious post-install behavior could capture the key or execute arbitrary commands in the agent environment.

Content

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

bash
npm install -g https://github.com/super21-bat/trek-agent-control/archive/refs/heads/main.tar.gz
trek config init --api-key 'trek_...' --url 'https://api.superd.fun/mcp'
trek skill sync --global
trek doctor

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

The instruction says the agent should complete installation, configuration, sync, and diagnostics without asking the user to run commands manually. In context, that encourages autonomous execution of networked and shell-based actions affecting the user's environment and live account, which can reduce informed consent and increase the chance of unintended changes or credential misuse.

Content

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

trek doctor

text

The mini program presents this to ordinary users as two steps: copy once, then send the copied bundle to WorkBuddy. WorkBuddy should complete installation, configuration, Skill sync, and `doctor` without asking the user to run commands manually. Treat the whole bundle as a secret. If native remote MCP is unavailable or unreliable, execute all operations through `trek`; it calls the same MCP endpoint. Read [references/configuration.md](references/configuration.md) for runtime details.

## Fast paths for common user requests

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill metadata invites broad use for planning and synchronization without clearly constraining when the skill should be invoked or what preconditions must be met. In an agentic environment, ambiguous activation can cause the agent to connect to a remote MCP and perform reads or writes on travel data in response to loosely related prompts, increasing the risk of unintended data access or modification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill guidance is written only in Chinese and includes prescriptive instructions for agent behavior, with no indication that language is selectable or that Chinese is required by a documented regional constraint. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The instruction says to send the bundle to WorkBuddy and explicitly says not to ask a non-technical user to choose between MCP and CLI, while the action label is presented only in Chinese. This constrains tool and language/locale behavior without offering user choice or documenting a justified region-specific requirement.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · MAINTAINING.md (reported line 91)May include surrounding context.

md
"mcpServers": {
    "trek": {
      "type": "streamable-http",
      "url": "https://api.superd.fun/mcp",
      "headers": {
        "Authorization": "Bearer ${TREK_MCP_TOKEN}"
      }

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/configuration.md (reported line 18)May include surrounding context.

md
"mcpServers": {
    "trek": {
      "type": "streamable-http",
      "url": "https://api.superd.fun/mcp",
      "headers": {
        "Authorization": "Bearer ${TREK_MCP_TOKEN}"
      }

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/configuration.md (reported line 52)May include surrounding context.

md
"mcpServers": {
    "trek": {
      "type": "streamable-http",
      "url": "https://api.superd.fun/mcp",
      "headers": {
        "Authorization": "Bearer ${TREK_MCP_TOKEN}"
      }

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/trek-mcp.mjs (reported line 25)May include surrounding context.

js
"mcpServers": {
    "trek": {
      "type": "streamable-http",
      "url": "https://api.superd.fun/mcp",
      "headers": {
        "Authorization": "Bearer ${TREK_MCP_TOKEN}"
      }

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This instruction installs executable code globally from a GitHub branch tarball, which is a mutable source rather than a pinned, integrity-verified release artifact. An attacker who compromises the repository, branch, or supply chain could deliver malicious code that gains execution on the user's machine during installation.

Content

Scanner excerpt · references/configuration.md (reported line 35)May include surrounding context.

bash
npm install -g https://github.com/super21-bat/trek-agent-control/archive/refs/heads/main.tar.gz
trek config init --api-key 'trek_...' --url 'https://api.superd.fun/mcp'
trek skill sync --global
trek doctor

Session Persistence

Medium
Category
Rogue Agent
Confidence
82% confidence
Finding

The skill describes installing persistent copies into agent skill directories and storing credentials in local configuration, enabling ongoing access beyond a single session. Although persistence is intentional for usability, it increases the blast radius if the host or agent environment is later compromised, especially because the skill can obtain write access to itinerary data after a health check.

Content

Scanner excerpt · references/configuration.md (reported line 64)May include surrounding context.

md
2. Run `trek config init` with the user's one-time key.
3. Add the native MCP block when supported.
4. Otherwise allow the agent to execute `trek ...`.
5. Run `doctor`; require `ok: true`, a protocol version, a positive tool count, and successful `list_trips` before giving write access.

`trek skill sync --global` delegates common Agent locations to the installed
Skills runner. Trek also installs real copies into detected WorkBuddy

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

L017 instructs use of an explicit market limited to china or global, with Mainland region or overseas country-code handling, which imposes a locale-specific routing rule. The file does not state that this is user-selected or justify the locale constraint as a region-specific product requirement.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/field-guide.md (reported line 88)May include surrounding context.

md
## Packing checklist fields

- Prefer the mini program's three low-effort built-in packing locations: `随身必带`, `衣物`, and `日用健康`. “自定义” is an action, not a category name: when the user needs a special grouping, write the actual reusable category name.
- Do not ask the user for a category when the item name makes it obvious. Infer it: identity documents, phone accessories, wallet and keys -> `随身必带`; clothing and footwear -> `衣物`; toiletries, sun protection, medicine, umbrella and tissues -> `日用健康`. If there is no stronger match and the user did not request a special grouping, omit `category` and let the service use the safe `随身必带` default.
- For a real trip-specific need, pass a concise custom category such as `露营装备`, `摄影器材`, or `儿童用品`. Once one item uses that category, the mini program offers it directly for later items in the same trip and groups all same-category items together. Reuse the exact existing category spelling from readback instead of creating near-duplicates.
- Legacy English/Chinese categories and historical `其他` remain readable. Do not create a category named after a place such as “为酒店准备”; use a reusable packing concept instead.
- Always send `quantity` when the user needs more than one item. Valid values are integers from 1 to 999.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/trek-mcp.mjs (reported line 431)May include surrounding context.

js
checks.push({ name: 'api-key', ok: Boolean(token?.startsWith('trek_')), value: redact(token), fix: 'Create a key in the Trek mini program, then run trek config init --api-key <key>.' });
  if (existsSync(configPath)) {
    const mode = statSync(configPath).mode & 0o777;
    checks.push({ name: 'config-permissions', ok: process.platform === 'win32' || mode === 0o600, value: process.platform === 'win32' ? 'managed-by-windows' : mode.toString(8), fix: `Run chmod 600 ${configPath}.` });
  } else {
    checks.push({ name: 'config-file', ok: Boolean(process.env.TREK_MCP_TOKEN || process.env.MCP_API_TOKEN), value: configPath, fix: 'Run trek config init.' });
  }

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The upload-file command reads an arbitrary local file path, base64-encodes the contents, and sends the full file to the configured remote MCP endpoint. While this is part of the feature’s intended behavior, the CLI help and command flow do not provide an explicit user-facing transmission warning or confirmation at the point of use, which increases the risk of accidental exfiltration of sensitive local files when invoked by an agent or script.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The set-cover command reads a local image file and uploads it to the remote service as base64 content, either through apply_trip_change or upload_trip_file. This is expected functionality, but the absence of a clear transmission warning or consent step makes accidental disclosure more likely, especially in an agent-driven workflow where the user may not realize a local file is being sent off-host.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The set-cover flow injects the default description text '行程封面', which forces a Chinese-language string when the user does not provide a description. This is a locale-specific behavior without user opt-in or documented justification, matching the policy's language/locale violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The smoke command creates test proposal fields using Chinese text such as '临时冒烟地点' and '测试完成自动删除', imposing a specific language in generated content. The file does not offer a language choice or explain that this CLI is intentionally limited to Chinese-language output.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE (reported line 592)May include surrounding context.

text
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF