T09 · Insecure Skill Coding Practices
- Location
scripts/create_angle_task.sh:37- Finding
Unsafe JSON Construction Allows Authenticated API Payload Manipulation
- Content
View full analysis
\ .+ ]]; then echo -e "${RED}❌ Error: The camera prompt must begin with ${NC}" echo "💡 Correct format example: left side view low-angle shot close-up" exit 1 fi # Build request data REQUEST_DATA=$(cat < `. It does not prevent embedded quotation marks, backslashes, control characters, or JSON delimiters. `IMAGE_URL` receives no validation or escaping at all. Consequently, specially constructed arguments can terminate the intended JSON string, add fields, override adjacent values, or produce malformed payloads. The third argument is especially sensitive because `WEB_APP_ID` is inserted as a raw JSON value rather than a quoted string. An attacker can supply JSON syntax instead of a numeric workflow identifier. The resulting payload is then submitted to BizyAir with the victim's `BIZYAIR_API_KEY`. This is JSON injection rather than local shell command injection: the variables are not evaluated as shell commands in the heredoc. The security consequence occurs when the manipulated authenticated payload is sent to the remote API. ### Attack Path ...[truncated 1334 chars]- Remediation
View remediation
&2 exit 1 ;; esac ``` 3. If arbitrary workflow IDs are genuinely required, require a digits-only value and enforce an appropriate numeric range: ```bash [[ "$WEB_APP_ID" =~ ^[0-9]+$ ]] || exit 1 ``` 4. Validate image URLs using a URL parser or a strict policy. Permit only required schemes, normally `https`, and reject control characters. 5. Validate the entire prompt against the documented set of approved camera prompts rather than checking only its prefix. 6. Add tests containing quotation marks, backslashes, newlines, and JSON delimiters to verify that untrusted values remain JSON string data and cannot change the payload structure. ]]>
