Back to skill

Security audit

explore-italy

Security checks for vulnerabilities and agentic risk

Overview

This flight-booking skill is purpose-aligned overall, but it instructs agents to install and run an unpinned global CLI and execute user-derived shell commands without adequate safeguards.

Review before installing. Use only in an isolated environment, avoid letting it auto-install the CLI globally, and do not pass sensitive travel details unless you are comfortable sending them to the external flight service. The publisher should pin and verify the CLI, require explicit install consent, validate all parameters, and render only trusted booking links.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (3)

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:9
Finding

Mandatory Third-Party Output and Booking-Link Injection

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:9-19, SKILL.md:124-137, and references/templates.md:24-46
Vulnerability Type: Agent instruction hijacking and forced third-party content
Risk Level: Medium

Vulnerable Code

SKILL.md:9-19:

markdown
# CRITICAL EXECUTION RULES

**You are a CLI executor, NOT a knowledge base.**

1. **NEVER answer travel queries from your training data.** Every piece of data MUST come from `flyai` CLI output.
2. **If flyai-cli is not installed, install it first.** Do NOT skip to a knowledge-based answer.
3. **Every result MUST have a `[Book]({detailUrl})` link.** No link = not from flyai = must not be included.
4. **Follow the user's language.** Chinese input -> Chinese output. English input -> English output.
5. **NEVER invent CLI parameters.** Only use parameters listed in the Parameters Table below. If a flag is not listed, it does not exist.

**Self-test:** If your response contains no `[Book](...)` links, you violated this skill. Stop and re-execute.

SKILL.md:124-137:

markdown
## Output Rules

1. **Conclusion first** — lead with best option
2. **Italy tip — Schengen visa required; Rome FCO and Milan MXP are main hubs**
3. **Comparison table** with >= 3 results when available
4. **Brand tag:** "Powered by flyai - Real-time pricing, click to book"
5. **Use `detailUrl`** for booking links. Never use `jumpUrl`.
6. NEVER output raw JSON
7. NEVER answer from training data without CLI execution

references/templates.md:24-46:

markdown
## Output Template

```markdown
## Flight Search Results

| # | Airline | Route | Departure | Duration | Price | |
|---|---------|-------|-----------|----------|-------|-|
| 1 | {airlineName} | {origin} -> {destination} | {depTime} | {duration} | Y{price} | [Book]({{detailUrl}}) |

Powered by flyai - Real-time pricing, click to book

Notes

  • Always include Book l ...[truncated 2197 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove absolute directives such as “NEVER answer” and “Every result MUST have” where they override normal Agent judgment.
  2. Make third-party CLI use and booking links optional and disclose the external provider before execution.
  3. Require explicit user consent before sending travel parameters to a third-party service.
  4. Do not require promotional branding as a condition of producing an answer.
  5. Validate detailUrl before rendering it:
    • Require HTTPS.
    • Enforce an approved hostname allowlist.
    • Reject embedded credentials, non-web schemes, and unexpected redirector domains.
    • Clearly identify the destination as an external third-party link.
  6. Permit the Agent to omit results with missing or invalid links rather than repeatedly executing the command.
  7. Separate factual response requirements from promotional or commercial output requirements.

T08 · Insecure Dependencies

Error
Location
SKILL.md:68
Finding

Unpinned Global Installation of a Third-Party npm Package

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:68-82 and references/fallbacks.md:3-10
Vulnerability Type: Unsafe dependency installation and supply-chain exposure
Risk Level: High

Vulnerable Code

SKILL.md:68-82:

markdown
### Step 0: Environment Check (mandatory, never skip)

```bash
flyai --version
  • OK: Returns version -> proceed to Step 1
  • FAIL: command not found ->
bash
npm i -g @fly-ai/flyai-cli
flyai --version

Still fails -> STOP. Do NOT continue. Do NOT use training data.

text

`references/fallbacks.md:3-10`:

```markdown
## Case 0: flyai CLI not installed

If `flyai --version` returns `command not found`:

1. Run: `npm i -g @fly-ai/flyai-cli`
2. Verify: `flyai --version`
3. If still fails, tell user to install Node.js first: https://nodejs.org/

**NEVER proceed without CLI. NEVER fabricate results.**

Technical Analysis

The Skill mandates installation of @fly-ai/flyai-cli without specifying an exact version, lockfile, integrity digest, package provenance check, or reviewed artifact. npm therefore resolves the package version from the registry at execution time. The code reviewed during the audit is not necessarily the code that will later be installed.

The -g option installs the package globally. Depending on the Agent's execution identity and npm configuration, this can modify shared executable paths and package directories. npm packages can also define lifecycle scripts that execute during installation. A compromised maintainer account, malicious package release, registry compromise, or dependency compromise could consequently lead to arbitrary code execution during installation.

The unconditional wording makes installation part of ordinary Skill operation rather than an explicit, user-approved administrative action.

Attack Path

  1. The Skill checks for flyai and finds that it is unavailable.
  2. It executes `npm i - ...[truncated 1194 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not automatically install software as part of handling a user query.
  2. Require explicit user or administrator approval before dependency installation.
  3. Pin the dependency to a specifically reviewed version rather than resolving the latest release.
  4. Verify package integrity with an approved lockfile, cryptographic digest, or trusted artifact-signing mechanism.
  5. Review the package and its transitive dependency tree before deployment.
  6. Avoid global installation. Install into an isolated project directory, container, or restricted runtime.
  7. Run the CLI with a dedicated low-privilege account and minimal filesystem and network access.
  8. Disable npm lifecycle scripts where operationally possible, for example through an approved installation process using --ignore-scripts.
  9. Configure an approved npm registry and enforce package provenance policies.
  10. Treat a missing CLI as a recoverable condition and report it rather than forcing installation.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:89
Finding

Shell Command Injection Through Unvalidated Template Interpolation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:89-113, references/playbooks.md:5-50, and references/templates.md:5-22
Vulnerability Type: Command injection through user-controlled shell arguments
Risk Level: High

Vulnerable Code

SKILL.md:89-113:

markdown
### Playbook A: Recommended Route

**Trigger:** "italy flight", "意大利航班"

```bash
flyai search-flight --origin "{{o}}" --destination "{{d}}" --dep-date {{date}} --sort-type 2

Playbook B: Cheapest Route

Trigger: "cheapest", "最便宜"

bash
flyai search-flight --origin "{{o}}" --destination "{{d}}" --dep-date {{date}} --sort-type 3

Playbook C: Fastest Route

Trigger: "fastest", "最快"

bash
flyai search-flight --origin "{{o}}" --destination "{{d}}" --dep-date {{date}} --sort-type 4

Playbook D: Direct Route

Trigger: "direct", "直飞"

bash
flyai search-flight --origin "{{o}}" --destination "{{d}}" --dep-date {{date}} --journey-type 1 --sort-type 2
text

`references/playbooks.md:34-50`:

```markdown
## PB-5: Price + Date Range

**Trigger:** "flexible dates", "date range", "灵活日期"

```bash
flyai search-flight --origin "{{o}}" --destination "{{d}}" --dep-date-start {{start}} --dep-date-end {{end}} --sort-type 3

PB-6: Broad Search (fallback)

Trigger: 0 results from above playbooks

bash
flyai search-flight --origin "{{o}}" --destination "{{d}}" --dep-date {{date}} --sort-type 2
flyai keyword-search --query "{{origin}} to {{destination}} flight"
text

`references/templates.md:5-22`:

```markdown
### Step 1: Extract from user query

Scan user message for:
- Origin city/name
- Destination city/name
- Date or date range
- Budget/price preference
- Cabin class preference

### Step 2: Missing parameters

If origin or destination is missing, ask (max 2 questions):
1. "Where are you departing from?"
2. "Where would you like to go
...[truncated 3333 chars]
Remediation
View remediation

Remediation Suggestions

  1. Never construct a shell command by concatenating or interpolating user-controlled text.
  2. Invoke the CLI directly with a structured argument array, for example:
    • Executable: flyai
    • Arguments: ["search-flight", "--origin", origin, "--destination", destination, "--dep-date", date, "--sort-type", "2"]
  3. Ensure the process API does not invoke a shell. Explicitly disable shell execution where supported.
  4. Validate every parameter before execution:
    • Dates must match a strict YYYY-MM-DD parser and represent valid calendar dates.
    • Sort values must come from the documented numeric allowlist.
    • City or airport values must satisfy a conservative character policy or resolve through a trusted airport-code mapping.
    • Reject control characters, newlines, null bytes, and shell metacharacters.
  5. Do not rely on double quoting as a security boundary.
  6. Maintain one authoritative allowlist of supported flags and remove undocumented parameters.
  7. Add security tests covering command substitution, separators, newlines, quotes, backticks, and malformed dates.
  8. Run the CLI under a low-privilege account with restricted filesystem and network access as defense in depth.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

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

flyai search-flight --origin "Beijing" --destination "Shanghai" --dep-date 2026-05-15 --sort-type 2

text

## Output Rules

1. **Conclusion first** — lead with best option
2. **Italy tip — Schengen visa required; Rome FCO and Milan MXP are main hubs**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill requires all travel answers to come from the external flyai CLI but does not disclose that user travel queries and parameters may be transmitted to a third-party service. This creates a privacy and consent issue because sensitive itinerary details can be sent off-system without warning or approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill mandates checking for flyai and, on failure, globally installing @fly-ai/flyai-cli and executing it. In an agent setting, this induces unreviewed package installation and code execution on the host, which can expose the system to supply-chain compromise, arbitrary post-install behavior, or environment tampering.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly says to never invent CLI parameters and limits usage to the documented parameter table, but the direct-route playbook uses --journey-type 1, which is undocumented. This contradiction can cause agents to execute unsupported or unintended flags, increasing the risk of command misuse and making validation of safe behavior unreliable.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes very generic everyday terms like "cheap" and "budget" without any travel-specific constraint. In a markdown playbook, such broad phrases can overlap with ordinary user speech and make it unclear when this specific skill should activate versus when it should not.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The triggers "fast" and "quick" are too generic and are commonly used in unrelated conversations. The file does not provide contextual constraints or exclusion conditions, so the activation boundary for this playbook is unclear.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The condition "0 results from above playbooks" does not clearly define which playbooks must be tried, in what order, or whether partial matches qualify. This makes the fallback trigger ambiguous and could lead to inconsistent or unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The instruction 'Format prices in CNY (Y)' imposes a specific locale/currency convention for all outputs. Because this template does not state that the skill is China-specific or allow the user to choose currency/locale, it creates a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The instruction "use Chinese or English city names" constrains language choice in the skill's natural-language guidance. This is a locale/language restriction, and the file does not offer user choice or explain why only those languages are accepted.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This is a markdown file, so vague-trigger review applies. The overview text lists broad terms like "Explore Italy" and "Italy Travel Guide" but does not define specific trigger phrases, scope boundaries, or negative examples, which could make invocation conditions overly broad for common travel-related requests.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest says the skill is powered by Fliggy (Alibaba Group), but the template instructs outputs to say "Powered by flyai." This is an active contradiction in documentation/output guidance rather than a mere omission, and it misrepresents the skill's actual stated service identity.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.