Back to skill

Security audit

AI机票预订助手

Security checks for vulnerabilities and agentic risk

Overview

This flight-booking skill is coherent in purpose, but it needs review because it handles bookings, refunds, API keys, and passenger PII with insecure transport and local storage practices.

Install only if you are comfortable with a Chinese-language flight assistant that can perform real booking, cancellation, rebooking, and refund actions through an external Fenbeitong-style API. Before using it with real passenger data, the publisher should fix TLS verification, restrict the API endpoint, move credentials and cached fare state into protected per-user storage, mask PII in output, and make refund/change confirmations unambiguous.

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 (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/common.py:159
Finding

TLS Certificate Verification Is Disabled for All API Requests

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/common.py:15
Finding

Environment-Controlled API Endpoint Can Exfiltrate Credentials and Passenger Data

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/common.py:20
Finding

API Key and Phone Number Are Stored in a Predictable Shared Temporary File

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/search_price.py:26
Finding

Predictable Temporary Fare-State Files Can Be Modified Before Booking or Rebooking

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create_order.py:89
Finding

Full Passenger PII and Authentication Secrets Are Exposed Through Output and Command-Line Arguments

Content
View full analysis
") print("Example: python3 create_order.py 1 \"Zhang San\" \"13800138000\" \"110101199001011234\"") sys.exit(1) seat_index = sys.argv[1] passenger_name = sys.argv[2] passenger_phone = sys.argv[3] passenger_id = sys.argv[4] print(f"\nCreating order...") print(f"Seat index: {seat_index}") print(f"Passenger name: {passenger_name}") print(f"Passenger phone: {passenger_phone}") print(f"Passenger identity number: {passenger_id}") ``` Order-detail output also prints complete PII: ```python passenger_info = passenger.get("passengerInfo", {}) name = passenger_info.get("name", "") phone = passenger_info.get("phone", "") id_card = passenger_info.get("identity_no", "") id_type_name = passenger_info.get("identity_type_name", {}).get("value", "") ticket_no = passenger.get("ticketNo", "") if name: print(f" - Name: {name}") if phone: print(f" - Contact phone: {phone}") if id_card and id_type_name: print(f" - Identity type: {id_type_name}") print(f" - Identity number: {id_card}") if ticket_no: print(f" - Ticket number: {ticket_no}") ``` SMS verification secrets are also read from command-line arguments: ```python elif action == "verify": if len(sys.argv) != 4: print("Usage: python3 auth.py verify ") sys.exit(1) phone = sys.argv[2] code = sys.argv[3] verify_and_get_api_key(phone, code) ``` ### Technical Analysis The implementation exposes f ...[truncated 1942 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description says the skill handles flight-related user tasks such as searching flights, checking fares, booking, rebooking, and refunds. However, the supplied code chunk does not implement any flight search, booking, change, or refund logic. Its actual purpose is user authentication through phone verification and apiKey management. While authentication could be a supporting component of a larger flight assistant, this chunk by itself performs a materially different function that is not represented in the declared description. Therefore, this code-description pairing is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The description presents a broad airline ticket assistant covering flight search, pricing, booking, rebooking, and refunds. The actual code chunk does not implement those functions; it specifically cancels an order via a cancelOrder API. Order cancellation is not explicitly described, and it is not clearly equivalent to ticket refund or flight change. Additionally, the code is invoked as a command-line script with an order_id argument, while no triggers are declared. Therefore the code behavior does not accurately match the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个覆盖航班搜索、价格查询、下单、改期、退票等完整流程的机票助手;而实际代码片段的功能明显更窄,仅实现“订单详情查询/展示”。这与声明的主要能力集不一致:一方面,代码执行了未明确声明的订单详情查询;另一方面,声明中的主要功能在该代码中均未体现。虽然订单详情与机票业务相关,但就此代码块本身而言,其实际目的与声明描述存在实质性偏差。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documents capabilities that read/write local files, use environment state, and make network requests, but it does not declare any explicit tool scope or permissions. In a booking workflow that handles API keys and passenger PII, missing scope boundaries increases the chance of unintended tool access, over-privileged execution, and weak review of sensitive operations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

A broad booking trigger such as '订这个/预订/下单' can overlap with ordinary travel conversation and cause the skill to enter a transactional path too early. In a workflow that can create paid orders and process PII, overly broad activation increases the risk of unintended order creation or premature collection/transmission of sensitive passenger data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Using a broad trigger like '退票' for refund submission is dangerous because users may mention refunds to ask about policy or fees, not to execute a refund. Given that refunding is a destructive action affecting paid tickets and money flows, ambiguous activation could lead to unintended refund processing if downstream confirmation handling is weak or inconsistent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The examples for order detail, cancellation, change, and refund include extra phone parameters that contradict the declared required arguments for the commands. In transactional travel flows, such inconsistencies can cause operators or agents to invoke commands incorrectly, leading to failed safeguards, accidental actions on the wrong order, or unintended disclosure of passenger phone data in command lines and logs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring and all user-facing CLI messages are written only in Chinese, which imposes a specific language on users. The file does not provide any opt-in, alternative locale, or explanation that this skill is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script's natural-language strings, including the error text, success message, usage text, and progress output, are all hardcoded in Chinese. The policy requires avoiding forced language or locale constraints unless the skill offers opt-in choice or clearly documents that it is region-specific, which this file does not do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module stores the apiKey and phone number in a predictable temp-directory file with no access control hardening, encryption, or user disclosure. On multi-user systems or compromised hosts, other local processes may read or tamper with these credentials, leading to account misuse or privacy exposure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code explicitly disables TLS certificate verification via ssl._create_unverified_context() before sending flight-search and booking traffic. This enables man-in-the-middle interception or modification of API requests and responses, which is especially dangerous here because the module handles apiKey authentication and personal travel data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The inline comment acknowledges that certificate verification should be enabled in production, but the live code still bypasses it. That mismatch increases risk because insecure test behavior has shipped into a flight-booking component that processes credentials and booking-related data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The API wrapper automatically injects the stored apiKey and sends request payloads containing business parameters and extra top-level fields such as name, phone, or idCard over HTTP requests. While the code includes error prints and developer docstrings, it does not provide a user-facing disclosure that potentially sensitive user or identity data will be transmitted to a remote service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script sends highly sensitive personal data (name, phone number, and national ID number) to an API as part of order creation, but the code provides no visible consent flow, privacy notice, minimization, or indication of transport/security guarantees. In a flight-booking context this data transfer may be functionally necessary, but absent masking, validation, logging controls, or explicit privacy handling, it increases the risk of privacy violations and accidental exposure through downstream systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script prints the full passenger phone number and ID card number directly to stdout before submitting the order. Console output is commonly captured in terminal history, logs, orchestration systems, or agent transcripts, so this behavior can leak sensitive identity data to unintended viewers or persistent storage.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script prints the full endorsement request payload immediately before submission, including order_id and ticket_ids and potentially additional passenger/segment metadata embedded in seat_item_copy. In a flight booking/change assistant, these identifiers are operationally sensitive and can leak through logs, terminal history, agent transcripts, or monitoring systems, increasing exposure of booking data without any clear functional need.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Sensitive order and ticket data is emitted to stdout with no masking or consent flow before the API call. In agentic or shared environments, stdout is commonly captured into centralized logs or shown back to users, so this can disclose booking references and ticket identifiers to parties who do not need them.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This Python file contains docstrings, usage text, status messages, and output labels exclusively in Chinese, which effectively forces a specific language for users. The provided policy says locale/language constraints should not be imposed unless the skill offers user choice or clearly documents a justified regional constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This Python file contains docstrings, comments, usage text, status messages, and output prompts entirely in Chinese, and the logic is explicitly tailored to Chinese display width. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script submits a refund request immediately after gathering product IDs, without any explicit user confirmation, dry-run step, or secondary verification. In a flight-booking skill, refund submission is a state-changing business action that can trigger irreversible workflow effects such as cancellation processing, audit queues, and financial consequences if invoked accidentally or with incorrect parameters.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This Python file uses Chinese-only natural-language strings in docstrings, comments, CLI usage text, status output, and result messages. That imposes a specific language/locale on users without offering a choice or documenting a justified region-specific requirement, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and all user-facing messages indicate the skill is designed to operate only in Chinese. Under the natural-language policy rules, forcing a specific language without user opt-in or a clearly documented regional justification is a policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description advertises a wide range of common travel tasks such as flight search, pricing, booking, rescheduling, and refunds without clear invocation boundaries or constraints. In an agent ecosystem, this can cause over-broad triggering on ordinary travel-related conversations, increasing the chance the skill is invoked unexpectedly for sensitive transactional flows involving bookings or changes.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The refund-fee display text says that confirmation will automatically submit the refund, which conflicts with the documented two-step workflow requiring a separate explicit refund application. In a destructive financial operation like ticket refund, ambiguous confirmation semantics can trick an agent or user into authorizing irreversible cancellation without clear intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Natural-language content in the module docstring and printed messages is fixed to Chinese, which can impose a language choice on users without offering alternatives. The policy allows locale constraints when they are explicitly justified or when users can choose; neither is present in this file.

Content

No source excerpt is available for this finding.