T09 · Insecure Skill Coding Practices
- Location
reference/workflow.md:94- Finding
Shell Command Injection Through User-Controlled Travel Parameters
- Content
View full analysis
Vulnerability Details
File Location:
reference/workflow.md:94-115
Vulnerability Type: Shell command injection
Risk Level: HighVulnerable Code
bash NODE_TLS_REJECT_UNAUTHORIZED=0 flyai keyword-search --query "[出发城市]出发 [天数]天 人均[预算/人数]以内 [偏好]"bash NODE_TLS_REJECT_UNAUTHORIZED=0 flyai search-flight \ --origin "[出发城市]" --destination "[候选目的地]" \ --dep-date [出发日期] --back-date [返回日期] \ --sort-type 3bash NODE_TLS_REJECT_UNAUTHORIZED=0 flyai search-hotel \ --dest-name "[目的地]" \ --check-in-date [入住日期] --check-out-date [退房日期] \ --max-price [预算/晚数/60%] --sort rate_descbash NODE_TLS_REJECT_UNAUTHORIZED=0 flyai search-poi --city-name "[目的地]"Technical Analysis
The workflow instructs the agent to place user-controlled values—including the departure city, destination, preferences, dates, and budget—directly into shell command templates.
Quoting a value with double quotes does not make arbitrary input safe in POSIX-compatible shells. Shell constructs such as
$(command)and backtick command substitution remain active inside double quotes. Several unquoted placeholders, including dates and calculated price values, provide additional opportunities for shell metacharacter injection.If the agent constructs a command string from these templates and executes it through a shell, an attacker can supply a crafted travel parameter that changes the command's behavior or executes an additional local command.
Attack Path
- An attacker provides a departure city, destination, or preference containing shell syntax, such as command substitution.
- The agent replaces a placeholder in one of the documented command templates without strict validation.
- The resulting string is passed to a shell.
- The shell evaluates the injected syntax before or while invoking the FlyAI CLI.
- The attacker's command executes with the same operating-system privile ...[truncated 690 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not construct shell command strings using user-controlled values.
- Invoke the CLI through a process API that accepts an executable and a separate argument array, with shell processing explicitly disabled.
- Apply allowlist validation to city and destination fields, restricting values to expected Unicode letters, spaces, hyphens, and other explicitly supported characters.
- Parse dates with a strict
YYYY-MM-DDvalidator and reject malformed values. - Parse budget, duration, and price parameters as bounded numeric values rather than text.
- Do not rely on double quotes or ad hoc escaping as the primary defense.
- Run the CLI under a dedicated, unprivileged account with minimal filesystem and network access.
- Add tests containing command substitutions, backticks, semicolons, newlines, redirections, and option-injection payloads.
