Back to skill

Security audit

Flyai Super Train / 火车票智能中转

Security checks for vulnerabilities and agentic risk

Overview

This train-ticket assistant is mostly coherent, but it persistently stores sensitive travel history and preferences without enough user control and relies on an unpinned global third-party CLI install.

Review this skill before installing if you do not want travel routes, dates, seat choices, and booking decisions saved locally. Prefer a pinned, locally installed flyai CLI version, avoid running npm with elevated privileges, and clear or disable the history and preferences files if persistent personalization is not desired.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:4
Finding

Unpinned Global Installation of a Third-Party CLI Package

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 4, 30, and 46
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: Medium

Vulnerable Code

yaml
compatibility: 需要 flyai-cli 已安装 (npm i -g @fly-ai/flyai-cli)
markdown
- 需要 `flyai-cli` 已安装:`npm i -g @fly-ai/flyai-cli`
text
npm i -g @fly-ai/flyai-cli

Technical Analysis

The skill repeatedly directs users or agents to install @fly-ai/flyai-cli globally without specifying an exact version or verifying package integrity. Consequently, npm resolves the package version from the registry at installation time, and the installed code may differ from the version reviewed when this skill was published.

npm packages can define lifecycle scripts such as preinstall, install, and postinstall. These scripts execute during installation with the privileges of the account running npm. A global installation also places executable files in a shared system- or user-level npm location, increasing the package's reach beyond this individual skill.

This is a supply-chain exposure rather than evidence that the named package is currently malicious. Exploitation depends on a malicious or compromised package release, registry/account compromise, or another upstream dependency compromise. The skill does not automatically execute the installation command, so exploitation also requires a user or agent to follow the documented setup or troubleshooting instructions.

Attack Path

  1. An attacker compromises the npm publisher account, package release process, or an upstream dependency associated with @fly-ai/flyai-cli.
  2. The attacker publishes a malicious version under the same package name or causes a malicious transitive dependency to be selected.
  3. A user or agent follows the setup or troubleshooting instructions and runs:
    bash
    npm i -g @fly-ai/flyai-cli
    
  4. npm selects the current reg ...[truncated 1282 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the CLI to a specifically reviewed version:

    bash
    npm install --global @fly-ai/flyai-cli@<reviewed-version>
    
  2. Record and verify the expected package integrity digest before installation. Where practical, use a lockfile and an installation method that enforces locked versions and integrity metadata.

  3. Prefer a project-local dependency over a global installation:

    bash
    npm install --save-exact @fly-ai/flyai-cli@<reviewed-version>
    

    Invoke the local binary through a controlled script or an explicitly pinned package runner.

  4. Do not automatically upgrade the CLI as a troubleshooting step. Require review and testing before changing the pinned version.

  5. Avoid running npm with administrator or root privileges. Execute installation and the CLI in a restricted account, container, or sandbox with only the filesystem and network access required for train searches.

  6. Review the package's lifecycle scripts, published provenance, maintainers, transitive dependencies, and registry source before approving a version.

  7. Configure an explicit trusted npm registry and disable lifecycle scripts during installation where compatible:

    bash
    npm install --global --ignore-scripts @fly-ai/flyai-cli@<reviewed-version>
    

    If lifecycle scripts are required, inspect them before permitting execution.

  8. Validate API responses and restrict booking URLs to an allowlist of expected HTTPS domains before displaying them to users.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L003 的描述全文为中文,且文档整体未说明这是仅面向特定中文用户群或区域合规场景,也未提供语言选择或用户 opt-in。根据规则,若技能强制特定语言/locale 而无选择机制,属于自然语言政策风险。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

L015 规定“用户提到火车票、高铁票、动车票、车次查询、余票、中转换乘、12306、坐席偏好等关键词时触发”,属于基于关键词的宽泛触发描述,且“等关键词”进一步扩大了范围。文档没有给出不应触发的反例或上下文限制,容易在普通出行讨论中发生非预期调用。

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly instructs using dialogue history and stored preferences to infer missing travel parameters, expanding personal data use beyond the immediate user request. In a travel context, origin/destination, time windows, and habits can reveal sensitive movement patterns, so silent inference increases privacy risk and the chance of over-collection or use without meaningful consent.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill directs persistent logging of detailed travel queries and purchase/abandonment decisions to history.json, creating a durable record of movement patterns and behavioral data. In this skill's context, travel itineraries, timestamps, transfer cities, and booking outcomes are highly sensitive and can expose home location, routines, and future travel plans if accessed improperly.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill asks to persist user preferences as defaults and even auto-saves some 'hard rules' without confirmation, which undermines user consent and can create long-lived sensitive profiles. In a travel assistant, seat, timing, and transfer preferences may seem innocuous individually, but over time they encode health, comfort, age-related, or routine-travel signals that should not be stored automatically.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The configuration hard-codes Chinese seat class values ("硬座", "硬卧") in a user preference file, which indicates the skill may assume a specific language/locale by default. The provided file does not show any user choice, opt-in, or documentation justifying a China-specific locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

该 Markdown 文件全文以中文编写,并在参数映射规则中默认要求解析中文用户表达,如“硬卧”“下午出发”等,但未说明这是面向中文用户的限定场景,也未提供其他语言/locale 选项。根据规则,强制特定语言而无用户选择或合理说明,属于自然语言层面的语言/locale 策略问题。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.