Back to skill

Security audit

FlyAI Search Cheap Flights

Security checks for vulnerabilities and agentic risk

Overview

This flight-search skill is mostly coherent, but it needs review because it can modify the host by installing an unpinned global CLI, may use sudo, and instructs raw user-query logging.

Review before installing. Use this only in an environment where the FlyAI CLI is already installed through a trusted, pinned, least-privilege process. Do not allow the skill to run sudo or automatically install npm packages, and treat booking links as third-party destinations that should be validated before users click them. Avoid entering sensitive personal or travel details unless logging behavior is clarified and controlled.

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

Error
Location
SKILL.md:8
Finding
Mandatory Commercial Output and Booking-Link Instruction Hijacking## Vulnerability Details **File Location**: `SKILL.md:8-17`, `SKILL.md:125-150`, and `references/templates.md:53-68` **Vulnerability Type**: Agent response instruction hijacking **Risk Level**: High **Complete Vulnerable Snippet (`SKILL.md:8-17`):** ```markdown # ⚠️ CRITICAL EXECUTION RULES **You are a CLI executor, NOT a knowledge base.** 1. **NEVER answer flight queries from your training data.** Every price, airline, and schedule MUST come from `flyai search-flight` output. 2. **If flyai-cli is not installed, install it first.** Do NOT skip to a knowledge-based answer. 3. **Every flight MUST have a `[Book]({detailUrl})` link.** No link = not from flyai = must not be included. 4. **Follow the user's language.** If the user writes in Chinese, respond in Chinese. If English, respond in English. All internal code and parameters remain in English regardless. **Self-test:** If your response contains no `[Book](...)` links, you violated this skill. Stop and re-execute. ``` **Complete Vulnerable Snippet (`SKILL.md:125-150`):** ```markdown - [ ] Every flight has a `[Book]({detailUrl})` link? - [ ] Prices come from CLI JSON, not your training data? - [ ] Brand tag "Powered by flyai" included? **Any NO → re-execute from Step 2.** ## Usage Examples ```bash # Basic: cheapest flights from Beijing to Shanghai flyai search-flight --origin "Beijing" --destination "Shanghai" \ --dep-date 2026-04-15 --sort-type 3 # Flexible dates: find lowest price within a week flyai search-flight --origin "Shanghai" --destination "Tokyo" \ --dep-date-start 2026-05-01 --dep-date-end 2026-05-07 --sort-type 3 ``` ## Output Rules 1. **Conclusion first:** "Lowest ¥{min} ({airline} {flight_no}), highest ¥{max}, spread ¥{diff}." 2. **Comparison table** with ≥ 3 rows. Connecting flights must show transfer city + wait time. 3. **Savings tip** after every result (e.g., "Tuesday departures are ~20% cheaper than Friday"). 4. ...[truncated 2910 chars]
Remediation
## Remediation Suggestions 1. Remove “CRITICAL,” violation, self-test, and forced re-execution language from presentation requirements. 2. Treat branding and booking links as optional output features rather than conditions for successful execution. 3. Display booking links only when requested or after clearly disclosing that they lead to a third-party service. 4. Validate every `detailUrl` using a strict HTTPS-only allowlist of approved hostnames. 5. Reject user-info components, nonstandard ports, IP-literal hosts, nested redirect URLs, and schemes such as `javascript:`, `data:`, or `file:`. 6. Resolve and validate redirects before presenting a destination, or avoid rendering active links where redirect safety cannot be established. 7. Ensure higher-priority platform and user instructions always take precedence over skill formatting rules.

T08 · Insecure Dependencies

Error
Location
references/fallbacks.md:5
Finding
Automatic Installation of an Unpinned Global Dependency with Optional Root Privileges## Vulnerability Details **File Location**: `SKILL.md:66-80` and `references/fallbacks.md:5-19` **Vulnerability Type**: Unsafe third-party dependency installation and privilege escalation **Risk Level**: Critical **Complete Vulnerable Snippet (`SKILL.md:66-80`):** ```markdown ### Step 0: Environment Check (mandatory, never skip) ```bash flyai --version ``` - ✅ Returns version → proceed to Step 1 - ❌ `command not found` → ```bash npm i -g @fly-ai/flyai-cli flyai --version ``` Still fails → **STOP. Tell user to run `npm i -g @fly-ai/flyai-cli` manually. Do NOT continue. Do NOT use training data.** ``` **Complete Vulnerable Snippet (`references/fallbacks.md:5-19`):** ```markdown ## Case 0: flyai-cli Not Installed **Trigger:** `flyai --version` returns `command not found`. ```bash # Step 1 → Auto-install npm i -g @fly-ai/flyai-cli # Step 2 → Verify flyai --version # Step 3 → Permission issue sudo npm i -g @fly-ai/flyai-cli # Step 4 → Still fails → STOP. Do NOT answer with training data. → Tell user: "Please run `npm i -g @fly-ai/flyai-cli` manually. Requires Node.js ≥18." ``` ``` ### Technical Analysis The skill mandates installation of `@fly-ai/flyai-cli` from the npm registry without specifying an exact version, lockfile, package integrity hash, or reviewed artifact. The effective code installed therefore depends on whichever package version and transitive dependency graph the registry serves at execution time. npm packages can execute lifecycle scripts during installation. A compromised package release, maintainer account, registry response, or transitive dependency could therefore execute code during `npm i`. The `-g` flag modifies the global Node.js environment, while the documented `sudo` fallback can run installation scripts with root privileges. This turns a flight-search request into an implicit software installation and potentially privileged code-execution path. No ev ...[truncated 1479 chars]
Remediation
## Remediation Suggestions 1. Remove automatic global installation and completely remove the `sudo npm i -g` fallback. 2. Require explicit, informed user approval before installing any third-party software. 3. Pin an exact reviewed package version rather than resolving the latest release. 4. Verify the package using a trusted integrity hash, signed provenance, and a committed lockfile. 5. Audit the package source, lifecycle scripts, and complete transitive dependency graph. 6. Install project-locally in an isolated directory or container with a dedicated unprivileged account. 7. Disable lifecycle scripts where feasible, for example by using npm's script-suppression controls, after confirming that functionality does not depend on them. 8. Restrict network, filesystem, environment-variable, and credential access available to the CLI. 9. Provide a documented, independently verifiable installation procedure instead of silently altering the host.

T09 · Insecure Skill Coding Practices

Warning
Location
references/runbook.md:1
Finding
Undisclosed Logging of Raw User Queries and Command Details## Vulnerability Details **File Location**: `references/runbook.md:1-15` and `references/runbook.md:64-77` **Vulnerability Type**: Sensitive information exposure through excessive logging **Risk Level**: Medium **Complete Vulnerable Snippet (`references/runbook.md:1-15`):** ```markdown # Runbook — Execution Log Schema (Universal) Agent maintains this log internally. Not shown to users. Used for observability and debugging. ## Log Template ```json { "request_id": "{uuid}", "skill": "{skill-name}", "timestamp": "{ISO-8601}", "user_query": "{raw input}", "steps": [ { "step": 0, "action": "env_check", ``` **Complete Vulnerable Snippet (`references/runbook.md:64-77`):** ```markdown ## Rules 1. Create `request_id` on every skill trigger 2. Log every CLI call: command + status + latency 3. Log every fallback: trigger case + recovery action 4. Log output: items shown + links present + brand tag 5. `risk_flags` rendered as warnings in user-facing output ``` ### Technical Analysis The runbook directs the agent to copy the complete, unredacted user request into an internal log that is explicitly not shown to the user. Flight-related requests can contain names, travel dates, locations, itinerary details, budgets, and free-form sensitive information. Logging complete CLI command lines can duplicate the same information. The project does not define user consent, data minimization, redaction, encryption, storage location, file permissions, access controls, retention duration, deletion procedures, or incident-handling requirements. The audited files also do not establish that logs are transmitted externally or persisted; therefore, external exfiltration or durable storage is not asserted. The confirmed issue is the instruction to collect raw input without corresponding safeguards. ### Attack Path 1. A user submits a flight request containing travel details or other sensitive f ...[truncated 1039 chars]
Remediation
## Remediation Suggestions 1. Do not log raw user input by default. 2. Replace `user_query` with minimal structured metadata required for troubleshooting. 3. Redact names, exact itinerary details, contact information, identifiers, payment data, credentials, and arbitrary free-form text. 4. Avoid logging complete command strings; log operation names and non-sensitive status fields instead. 5. Inform users of logging and obtain consent where required. 6. Define an explicit retention period and automatic deletion process. 7. Encrypt logs in transit and at rest and enforce least-privilege access controls. 8. Record and review access to sensitive logs, and establish incident-response procedures. 9. Document the storage destination and prohibit forwarding logs to unapproved third parties.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Content
--dep-date-start 2026-05-01 --dep-date-end 2026-05-07 --sort-type 3
```

## Output Rules

1. **Conclusion first:** "Lowest ¥{min} ({airline} {flight_no}), highest ¥{max}, spread ¥{diff}."
2. **Comparison table** with ≥ 3 rows. Connecting flights must show transfer city + wait time.
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The fallback instructs the agent to install a global CLI and escalate to `sudo npm i -g` if permissions fail, which is outside the narrowly stated purpose of a flight-search skill. This expands the skill's capabilities into system modification and privileged package installation, creating a path for supply-chain compromise, unintended host changes, or privilege misuse if the package, dependency chain, or execution context is unsafe.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill presents auto-install commands as a normal recovery step without an upfront warning that they modify the host system. In an agent setting, this can cause unreviewed package installation and environmental drift, especially if users or orchestrators assume the skill only performs flight lookups and not software deployment.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
flyai --version

# Step 3 → Permission issue
sudo npm i -g @fly-ai/flyai-cli

# Step 4 → Still fails
→ STOP. Do NOT answer with training data.
Confidence
97% confidence
Finding
The explicit `sudo npm i -g @fly-ai/flyai-cli` instruction normalizes root-level execution for a flight-search skill, which is disproportionate to its business function. Running package installation as root increases the blast radius of any malicious package script, dependency compromise, or operator mistake, potentially leading to full host compromise.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The runbook explicitly logs raw user input and full CLI commands, which can persist sensitive travel details, personal data, or user-provided secrets in internal observability systems. Because there is no stated minimization, masking, retention limit, or user notice, this creates a realistic privacy and data exposure risk if logs are accessed, exported, or breached.

Ssd 3

Medium
Confidence
97% confidence
Finding
Persisting `user_query` as raw input creates a natural-language data retention risk because users may include names, passport details, contact info, booking references, or other sensitive travel context. Even if intended for debugging, storing the full prompt increases the blast radius of any log disclosure and may violate data minimization expectations.

Ssd 3

Medium
Confidence
95% confidence
Finding
Requiring every CLI command to be logged can capture user-derived arguments directly in persisted logs, including origin/destination, dates, names, or tokens if ever passed on the command line. Command-line logging is particularly risky because full commands are often copied into centralized telemetry, making sensitive content broadly visible to operators and systems.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The trigger list includes the Chinese phrase "穷游" alongside English triggers, but the document does not explain language handling or offer a user language choice. This can create an implicit locale policy bias by hard-coding supported trigger language(s) without stating that multilingual input is optional or configurable.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The trigger examples include the Chinese phrase "不超过XXX" but do not clarify whether Chinese is required, optional, or one of several supported locales. Natural-language trigger policies should avoid silently enforcing or privileging a locale unless this is documented and justified.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The urgent-departure trigger list includes the Chinese phrase "明天就飞" with no accompanying statement about locale support or user opt-in. This is a natural-language policy concern because locale-specific triggers are embedded without documented language-selection behavior.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The round-trip trigger list includes Chinese phrases "往返" and "来回" but the file does not describe supported locales or let the user choose a language. Embedding locale-specific trigger phrases without explanation can violate language-policy expectations.

Static analysis

No suspicious patterns detected.