Back to skill

Security audit

Google Flights Realtime API

Security checks for vulnerabilities and agentic risk

Overview

This flight-search skill has a legitimate purpose, but its date-range instructions push agents to generate and run parallel shell scripts with user-derived values and potentially large paid API fan-out.

Review before installing. Use this only with a RapidAPI key you are comfortable spending quota on, avoid broad date/destination ranges, and prefer a version that validates IATA codes and dates, uses structured HTTP requests instead of generated shell scripts, sets hard request limits, and asks before large searches.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:147
Finding
User-Controlled Values Embedded into Generated Bash and Python Code## Vulnerability Details **File Location**: `SKILL.md`, lines 147-166 **Vulnerability Type**: Command and code injection through unsafe script generation **Risk Level**: High ### Vulnerable Code ```bash TMPDIR=$(mktemp -d) # Expand ALL dimensions from the user's request: NIGHTS=(3 4 5) # e.g. "3-5 night trips" → 3, 4, 5 DESTINATIONS=("CDG" "PRG") # e.g. "Paris or Prague" → CDG, PRG DATES=("2026-05-01" "2026-05-02" "2026-05-03") # expand to all dates in range for DEST in "${DESTINATIONS[@]}"; do for N in "${NIGHTS[@]}"; do for DATE in "${DATES[@]}"; do RETURN=$(python3 -c "from datetime import datetime,timedelta; print((datetime.strptime('$DATE','%Y-%m-%d')+timedelta(days=$N)).strftime('%Y-%m-%d'))") curl -s -X POST "https://google-flights-live-api.p.rapidapi.com/api/google_flights/roundtrip/v1" \ -H "Content-Type: application/json" \ -H "x-rapidapi-host: google-flights-live-api.p.rapidapi.com" \ -H "x-rapidapi-key: $RAPIDAPI_KEY" \ -d "{\"departure_date\": \"$DATE\", \"return_date\": \"$RETURN\", \"from_airport\": \"TLV\", \"to_airport\": \"$DEST\", \"currency\": \"usd\"}" \ -o "$TMPDIR/${DEST}_${N}n_${DATE}.json" & done done done ``` ### Technical Analysis The Skill instructs the agent to generate and execute a shell script from dimensions derived from the user's request. The generated values are placed into several syntactic contexts without a documented validation or safe-serialization boundary: - `DATE` is interpolated directly into Python source passed to `python3 -c`. - `N` is interpolated as an unquoted Python expression in `timedelta(days=$N)`. - `DATE`, `RETURN`, and `DEST` are manually interpolated into JSON rather than encoded by a JSON serializer. - `DEST`, `N`, and `DATE` are used to construct output filenames. - The generated `DATES`, `NIGHTS`, and `DESTINATIONS` array declarations are themselves execut ...[truncated 2196 chars]
Remediation
## Remediation Suggestions 1. Replace generated shell code with a fixed, reviewed implementation whose structure cannot be changed by user input. 2. Validate all dates against a strict `YYYY-MM-DD` format and confirm them through a date parser before execution. 3. Accept night counts only as bounded decimal integers and reject signs, expressions, whitespace, and metacharacters. 4. Validate airport and airline codes with an allowlist such as `^[A-Z]{3}$` after mapping city names to canonical IATA codes. 5. Pass dynamic values to Python through positional arguments or standard input rather than interpolating them into `python3 -c` source. 6. Construct request bodies with a JSON serializer, for example `jq -n --arg`, instead of manual quoting. 7. Use generated opaque identifiers for temporary filenames rather than incorporating user-controlled values. 8. Use Bash argument arrays and quote every expansion. Do not generate Bash array declarations from raw user text. 9. Add cleanup through `trap 'rm -rf -- "$TMPDIR"' EXIT` so temporary data is removed on errors and interruption. 10. Update the README to accurately disclose that the Skill executes local tools and generated request orchestration logic.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:141
Finding
Mandatory Unbounded Parallel Expansion Can Exhaust API Quotas and Incur Charges## Vulnerability Details **File Location**: `SKILL.md`, lines 141-175 **Vulnerability Type**: Unbounded authenticated request fan-out and resource consumption **Risk Level**: Medium ### Vulnerable Code ```markdown **Example parallel date-range scan (MUST use this pattern for date ranges):** When the user asks for a date range, generate a bash script that fires all curl requests in parallel using background processes. Write each response to a temp file, then combine. ```bash #!/bin/bash TMPDIR=$(mktemp -d) # Expand ALL dimensions from the user's request: NIGHTS=(3 4 5) # e.g. "3-5 night trips" → 3, 4, 5 DESTINATIONS=("CDG" "PRG") # e.g. "Paris or Prague" → CDG, PRG DATES=("2026-05-01" "2026-05-02" "2026-05-03") # expand to all dates in range for DEST in "${DESTINATIONS[@]}"; do for N in "${NIGHTS[@]}"; do for DATE in "${DATES[@]}"; do RETURN=$(python3 -c "from datetime import datetime,timedelta; print((datetime.strptime('$DATE','%Y-%m-%d')+timedelta(days=$N)).strftime('%Y-%m-%d'))") curl -s -X POST "https://google-flights-live-api.p.rapidapi.com/api/google_flights/roundtrip/v1" \ -H "Content-Type: application/json" \ -H "x-rapidapi-host: google-flights-live-api.p.rapidapi.com" \ -H "x-rapidapi-key: $RAPIDAPI_KEY" \ -d "{\"departure_date\": \"$DATE\", \"return_date\": \"$RETURN\", \"from_airport\": \"TLV\", \"to_airport\": \"$DEST\", \"currency\": \"usd\"}" \ -o "$TMPDIR/${DEST}_${N}n_${DATE}.json" & done done done wait cat "$TMPDIR"/*.json | jq -s 'flatten' rm -rf "$TMPDIR" ``` This fires ALL combinations concurrently. For example, "3-5 nights from TLV to Paris or Prague anywhere in May" = 31 dates × 3 night options × 2 destinations = 186 requests — all in parallel. The API handles up to 150 concurrent requests per minute, so batch into groups of ~100 with a short sleep between batches if the total exceeds 150. ` ...[truncated 2315 chars]
Remediation
## Remediation Suggestions 1. Calculate the complete request count before issuing any network call. 2. Define a conservative hard limit for one operation, such as 20 or 50 requests by default. 3. Require explicit user confirmation when the calculated count exceeds a small threshold, and disclose possible quota or monetary impact. 4. Enforce bounded concurrency with a worker pool rather than starting one background process per combination. 5. Apply limits independently to date-range length, destination count, and duration count. 6. Read plan-specific quotas from configuration where possible and refuse work that would exceed the remaining allowance. 7. Stop or reduce concurrency immediately after rate-limit, authentication, billing, or repeated server errors. 8. Add request deduplication and caching where permitted so identical searches do not consume additional quota. 9. Allow users to request staged searches, such as sampling dates first and expanding only promising results. 10. Document the actual request count and completion status in the user-visible result.
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
The date-range logic instructs the agent to generate and run a parallel bash script with temp directories, background jobs, file writes, and embedded variable expansion. This materially exceeds the least-privilege needs of flight search and increases risk of command injection, filesystem misuse, resource exhaustion, and rate-limit abuse if any user-controlled values reach the script without strict validation.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger patterns are broad phrases like `round trip`, `cheap flights`, and `fly to`, which can match ordinary conversation and invoke the skill unexpectedly. Unintended activation can cause silent transmission of user travel details to a third-party API, especially because the skill is designed to act immediately with minimal confirmation.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The setup/API description explains the RapidAPI dependency but does not clearly disclose to end users that their origin, destination, dates, and related travel preferences will be sent to a third-party service. In context, this is more dangerous because the skill also encourages immediate execution without confirmation, reducing user awareness and informed consent around external data sharing.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The skill mandates use of shell commands (`curl`) rather than a constrained HTTP/tool interface, expanding the agent's execution surface beyond what is necessary for a flight-search task. Even if the immediate examples are benign, requiring shell usage creates a pathway for command-construction mistakes, unsafe interpolation, and future prompt-driven command injection in a context that only needs outbound API requests.

External Transmission

Medium
Category
Data Exfiltration
Content
**Example one-way search:**

```bash
curl -X POST "https://google-flights-live-api.p.rapidapi.com/api/google_flights/oneway/v1" \
  -H "Content-Type: application/json" \
  -H "x-rapidapi-host: google-flights-live-api.p.rapidapi.com" \
  -H "x-rapidapi-key: $RAPIDAPI_KEY" \
Confidence
87% confidence
Finding
This skill is explicitly designed to transmit user-supplied travel search data to an external API over the network, so the external transmission is intentional and functional. However, it remains a real security/privacy concern because user itinerary data is sent off-platform and the request includes a sensitive API credential in headers, making clear disclosure, minimization, and safe handling necessary.

Static analysis

No suspicious patterns detected.