T09 · Insecure Skill Coding Practices
- Location
scripts/bizyair_api.sh:101- Finding
Unsafe JSON Construction in the Shell API Fallback
- Content
View full analysis
- Remediation
View remediation
10 )); then echo "Error: batch size must be an integer from 1 through 10" >&2 exit 1 fi PAYLOAD=$(jq -n \ --arg prompt "$FINAL_PROMPT" \ --argjson web_app_id "$WEB_APP_ID" \ --argjson width "$WIDTH" \ --argjson height "$HEIGHT" \ --argjson batch_size "$BATCH_SIZE" \ '{ web_app_id: $web_app_id, suppress_preview_output: true, input_values: { "107:BizyAirSiliconCloudLLMAPI.user_prompt": $prompt, "81:EmptySD3LatentImage.width": $width, "81:EmptySD3LatentImage.height": $height, "81:EmptySD3LatentImage.batch_size": $batch_size } }') ``` 2. Pass the resulting payload with `curl --data-binary "$PAYLOAD"`. 3. Enforce a batch range of 1 through 10 before making any network request. 4. Validate all numeric fields with strict integer syntax before using `--argjson`. 5. Use `curl --fail-with-body --show-error` and check the exit status so HTTP errors are not treated as valid API responses. 6. Add tests covering quotes, backslashes, control characters, Unicode, JSON delimiters, negative values, nonnumeric batches, and batches above 10. ]]>
