T09 · Insecure Skill Coding Practices
- Location
roles/flight-expert.md:14- Finding
Shell Command Injection Through Flight Search Parameters
- Content
View full analysis
Vulnerability Details
File Location:
roles/flight-expert.md, lines 14-30
Vulnerability Type: T09: Insecure Skill Coding Practices
Risk Level: Highbash # Outbound flight search flyai search-flight --origin "{departure_city}" --destination "{destination_city}" --dep-date "{departure_date}" # Return flight search flyai search-flight --origin "{destination_city}" --destination "{departure_city}" --dep-date "{return_date}" # Sort by ascending price flyai search-flight --origin "{departure_city}" --destination "{destination_city}" \ --dep-date "{date}" --sort-type 3 # Apply a maximum price flyai search-flight --origin "{departure_city}" --destination "{destination_city}" \ --dep-date "{date}" --max-price 2000 # Prefer direct flights flyai search-flight --origin "{departure_city}" --destination "{destination_city}" \ --dep-date "{date}" --sort-type 8Technical Analysis
The documented commands interpolate user-controlled city and date values into shell command strings. Double quotation marks do not provide a security boundary when an attacker can include a quotation mark in the substituted value. A crafted value can terminate the quoted argument and introduce shell operators such as command substitution, pipes, redirections, or command separators.
The vulnerability applies when an agent or integration constructs these command strings through direct textual substitution and submits them to a shell. The documentation does not require strict input validation, escaping, or argument-array execution.
Attack Path
- An attacker submits a crafted departure city, destination, or date containing a closing quotation mark and shell syntax.
- The agent substitutes the value into one of the documented command templates.
- The resulting command is passed to a shell rather than directly to the
flyaiexecutable as an argument array. - The shell interprets the injected syntax as addi ...[truncated 719 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not build shell command strings through textual interpolation.
- Invoke
flyaidirectly with an argument array, ensuring that each city and date remains a single argument. - Validate dates against a strict calendar-date format such as
YYYY-MM-DD. - Apply explicit length and character restrictions to city and airport inputs.
- Reject control characters, quotation marks, command substitutions, redirection operators, and shell separators if shell execution cannot be eliminated.
- Do not use
shell=True,bash -c,sh -c, or equivalent shell-evaluation mechanisms. - Run the command with a minimally privileged service account and a restricted environment.
- Add tests using adversarial values containing quotation marks, semicolons, pipes, newlines, backticks, and command substitutions.
