T09 · Insecure Skill Coding Practices
- Location
arena.sh:68- Finding
Arbitrary Python and OS Command Execution Through Search Query Injection
- Content
View full analysis
- Remediation
View remediation
&2 exit 2 fi ``` 2. Use the same data-not-code principle throughout the script. Construct JSON request bodies through a JSON serializer rather than interpolating identifiers into JSON strings. 3. Restrict the runtime account to the minimum filesystem and network permissions required. 4. Store the API key in a dedicated secret store or narrowly permissioned file rather than a general-purpose `.env` file. Ensure the file is readable only by its owner. 5. Add regression tests containing quotes, semicolons, newlines, command-like text, and Python syntax to verify that all search input is treated strictly as data. 6. Consider using `curl --get --data-urlencode "searchString=$1"` to avoid invoking a language interpreter solely for URL encoding. ]]>
