T09 · Insecure Skill Coding Practices
- Location
scripts/sahaba_search.sh:12- Finding
Arbitrary Python Code Execution Through Unsafely Interpolated Search Query
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This search skill mostly matches its stated purpose, but its query handling can turn a crafted search term into local code execution.
Install only after the query-encoding bug is fixed. Treat any search text as data sent to dorar.net, and avoid using untrusted or sensitive query strings until the shell script passes the query to Python as an argument or uses curl data-urlencode instead of building Python source dynamically.
scripts/sahaba_search.sh:12Arbitrary Python Code Execution Through Unsafely Interpolated Search Query
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$QUERY'))")
RESULT=$(curl -s -L \
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" \
-H "Accept: application/json, text/javascript, */*" \
-H "Referer: https://dorar.net/" \
The script sends the user's raw search query to dorar.net over the network without any user-facing notice or consent prompt. Even if this is necessary for functionality, queries may contain sensitive religious, personal, or investigative topics, creating a privacy leak to a third party.
With no manifest available, this script appears to be a stdin JSON/HTML parsing utility, but it additionally reads a query from the process environment to construct and emit a search URL. Accessing environment-derived context is not obviously required for the parser behavior implemented elsewhere in the file, so this is an unjustified extra capability relative to the apparent purpose.
The natural-language description states that the script returns results in Arabic, but it does not indicate that language selection is optional or justified as a region-specific constraint. This can be a locale policy concern because the skill appears to impose a specific language without user opt-in.
Exporting the user query as an environment variable makes the value available to child processes, increasing accidental exposure through process inspection, crash reports, debugging, or downstream tooling. This is a smaller issue than network exfiltration, but it still broadens the query's exposure surface without disclosure.