T09 · Insecure Skill Coding Practices
- Location
scripts/common.py:157- 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
The skill appears to be a real flight-booking helper, but it handles credentials, identity data, and ticket transactions with unsafe storage, logging, and network protections.
Review before installing or using for real bookings. Only proceed if you trust the external flight service and can tolerate the current risks; the safer path is to enable normal TLS verification, restrict the API endpoint, move credentials and transaction files into user-private storage with restrictive permissions, redact passenger identity data from output, and require an explicit separate confirmation before refund or change submission.
scripts/common.py:157TLS Certificate Verification Is Disabled for All API Requests
scripts/common.py:15Environment-Controlled API Endpoint Can Redirect Authentication Secrets and Passenger Data
scripts/common.py:20Long-Lived API Key Is Stored in a Predictable Shared Temporary File
scripts/create_order.py:96Full Passenger Identity Data Is Exposed in Command Output
scripts/search_price.py:26Predictable Temporary Transaction Files Can Be Tampered With Before Booking or Endorsement
The declared description focuses on flight search and ticket operations, but the skill also performs phone-based authentication, verification-code handling, apiKey acquisition, and persistent credential storage. Undisclosed auth and credential-management behavior is security-relevant because it changes the trust boundary and causes users to provide sensitive data and create persistent local state they were not clearly warned about in the top-level declaration.
The declared description focuses on flight search and ticket operations, but the skill also performs phone-based authentication, verification-code handling, apiKey acquisition, and persistent credential storage. Undisclosed auth and credential-management behavior is security-relevant because it changes the trust boundary and causes users to provide sensitive data and create persistent local state they were not clearly warned about in the top-level declaration.
The declared description focuses on flight search and ticket operations, but the skill also performs phone-based authentication, verification-code handling, apiKey acquisition, and persistent credential storage. Undisclosed auth and credential-management behavior is security-relevant because it changes the trust boundary and causes users to provide sensitive data and create persistent local state they were not clearly warned about in the top-level declaration.
The trigger phrase '退票' is overly broad for a destructive refund-submission action and could match users merely asking about refund policy, eligibility, or fees. In this context, where refunds affect paid orders and may be hard to reverse, over-triggering materially raises the chance of unintended transaction execution.
The refund display text says the system will automatically submit a refund application, which directly conflicts with the stated requirement to wait for explicit user confirmation before performing the destructive action. In a financial/transactional workflow, this ambiguity can cause unintended refunds or unauthorized irreversible actions if an agent follows the wrong instruction path.
The code disables TLS certificate verification by creating an unverified SSL context for outbound API calls. This allows man-in-the-middle attackers to intercept or modify flight search, booking, authentication, and personal data traffic, which is especially dangerous in a travel-booking skill handling credentials and user PII.
The skill declares no explicit tool scope or permissions despite instructing use of Python scripts that perform network access, local file reads/writes, and access to auth state in the user's home directory and /tmp. This weakens containment and reviewability, making it easier for the skill to exercise broader capabilities than a host or user may expect, especially when handling PII and persistent credentials.
The natural-language description and all invocation guidance are presented only in Chinese, and the skill name/behavior do not state that it is intentionally limited to Chinese-speaking or region-specific users. Under the stated policy, forcing a specific language without opt-in is a locale-policy concern.
Using the broad trigger phrase '预订' can activate the skill for loosely related travel-booking requests and may push the agent into a transactional flow prematurely. Because this skill can lead to PII collection, external API calls, and order creation, overbroad activation increases the risk of unintended data sharing or accidental commerce actions in ambiguous conversations.
The full-flow examples contradict the earlier command definitions by adding phone-number parameters to later order operations that were not specified in the canonical command interface. In security-sensitive transaction flows, contradictory invocation semantics can lead to wrong parameter binding, accidental disclosure of phone numbers on the command line, bypass of expected checks, or implementation drift where agents invoke the wrong action with sensitive identifiers.
The module docstring and all user-facing CLI messages are written only in Chinese, indicating a fixed language choice for the skill. The file does not offer any language/locale opt-in or explain that the skill is intended only for a Chinese-speaking or region-specific context.
The manifest describes flight search, cabin/price queries, booking, ticket changes, and ticket refunds, but does not mention order cancellation. This script directly calls a cancelOrder operation, which is a distinct order-management capability not clearly covered by the declared description.
The skill stores the apiKey, phone number, and authentication metadata in a predictable file under the system temporary directory. Temporary directories are often accessible to other local users or processes and are not appropriate for long-lived secrets, creating risk of credential theft or session hijacking.
The comment claims certificate verification should only be bypassed outside production, but the live implementation actively disables verification. This mismatch increases operational risk because reviewers or operators may wrongly assume TLS is being validated when it is not.
The function automatically injects the apiKey and sends it along with business parameters and extra personal fields such as phone or idCard over the network. While the docstring describes the API call for developers, there is no user-facing disclosure that potentially sensitive personal and authentication data will be transmitted to a remote service.
The authenticated API path repeats the same insecure TLS-bypass pattern while suggesting verified TLS should be used. Because this path sends apiKey and booking-related data, the contradiction can hide a real transport-security failure in the most sensitive request flow.
The script collects and transmits highly sensitive personal data, including name, phone number, and government ID number, directly to an API and also prints that data to stdout. In a flight-booking context this data flow is expected for legitimate order creation, but the lack of masking, privacy notice, minimization, or safeguards increases the risk of PII exposure through logs, terminals, shell history, or downstream API handling.
The script prints the full order_data object immediately before submitting the endorsement request, which likely includes order identifiers, ticket/product IDs, and flight/segment details. In a flight-booking skill, these are sensitive transactional data and may be exposed in terminal logs, agent traces, or shared session output, enabling unauthorized viewing or reuse of booking-related information.
This code uses Chinese-only docstrings, status messages, errors, and usage examples throughout the script, which enforces a specific language for users. The file does not offer any language selection, fallback, or justification that the skill is intentionally limited to a Chinese-only regional context.
Docstrings, usage text, status messages, and prompts are all presented only in Chinese. This forces a specific language/locale without any opt-in, fallback, or documented region-specific constraint, which matches the stated natural-language policy concern.
The script writes order- and flight-related data, including seat options and booking context, to a temporary JSON file on disk without any visible access controls, retention policy, or user warning. In a flight-booking context this data can be sensitive operational or personal travel information, and storing it in temp locations increases the risk of unintended disclosure to other local users, processes, or later runs.
The script performs a state-changing refundApply API call immediately after gathering product IDs, without any explicit user confirmation, review step, or safeguard against accidental execution. In a flight-booking skill, refunds are financially sensitive and can be difficult or impossible to reverse once submitted, so accidental or induced invocation can cause real monetary and operational harm.
The file contains comments, usage text, status messages, and output headers exclusively in Chinese, including user-facing strings at L32, L40, L60, and L65-L76. This imposes a specific language on all users without any opt-in, configuration, or documented justification for a locale restriction.
This file contains natural-language instructions, errors, and status messages entirely in Chinese, including the module docstring and CLI output. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified, which is not present here.
This code uses Chinese-only docstrings, comments, usage text, and runtime output throughout the file, which imposes a specific language/locale on users without any opt-in or alternative. The policy explicitly flags language or locale restrictions when the skill does not offer user choice or document a justified regional constraint.