T09 · Insecure Skill Coding Practices
- Location
scripts/common.py:159- Finding
TLS Certificate Verification Is Disabled for All API Requests
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
scripts/common.py:159TLS Certificate Verification Is Disabled for All API Requests
scripts/common.py:15Environment-Controlled API Endpoint Can Exfiltrate Credentials and Passenger Data
scripts/common.py:20API Key and Phone Number Are Stored in a Predictable Shared Temporary File
scripts/search_price.py:26Predictable Temporary Fare-State Files Can Be Modified Before Booking or Rebooking
scripts/create_order.py:89Full Passenger PII and Authentication Secrets Are Exposed Through Output and Command-Line Arguments
")
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]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.
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.
声明描述的是一个覆盖航班搜索、价格查询、下单、改期、退票等完整流程的机票助手;而实际代码片段的功能明显更窄,仅实现“订单详情查询/展示”。这与声明的主要能力集不一致:一方面,代码执行了未明确声明的订单详情查询;另一方面,声明中的主要功能在该代码中均未体现。虽然订单详情与机票业务相关,但就此代码块本身而言,其实际目的与声明描述存在实质性偏差。
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.