T09 · Insecure Skill Coding Practices
- Location
scripts/research_create.sh:26- Finding
Bypassable Sensitive-File Upload Guard for Research Output Schemas
- Content
View full analysis
&2 echo "Use a dedicated JSON schema file (for example: schema.json)." >&2 exit 1 ;; esac if [ ! -f "$SCHEMA_FILE" ]; then echo "Error: SCHEMA_FILE does not exist: $SCHEMA_FILE" >&2 exit 1 fi # Guard: reject files larger than 50MB _size="$(wc -c < "$SCHEMA_FILE")" if [ "$_size" -gt 52428800 ]; then echo "Error: SCHEMA_FILE exceeds 50MB limit: $SCHEMA_FILE" >&2 exit 1 fi OUTPUT_SCHEMA_JSON="$(jq -c '.' "$SCHEMA_FILE")" PAYLOAD="$(jq -n \ --arg instructions "$INSTRUCTIONS" \ --arg model "$MODEL" \ --argjson outputSchema "$OUTPUT_SCHEMA_JSON" \ '{ instructions: $instructions, model: $model, outputSchema: $outputSchema }')" else PAYLOAD="$(jq -n \ --arg instructions "$INSTRUCTIONS" \ --arg model "$MODEL" \ '{ instructions: $instructions, model: $model }')" fi curl -s -X POST 'https://api.exa.ai/research/v1' \ -H "x-api-key: $EXA_API_KEY" \ -H 'Content-Type: application/json' \ -d "$PAYLOAD" ``` ### Technical Analysis The script accepts a caller-controlled `SCHEMA_FILE`, reads its complete JSON content, inserts that content into the `outputSchema` request property, and transmits it to `https://api.exa.ai/research/v1`. The protective control is a filename denylist. It does not establish that the selected file is ...[truncated 2484 chars]- Remediation
View remediation
