other
Warning
- Location
- scripts/search_searx.sh:20
- Finding
- Search Queries Are Disclosed to More Third-Party Instances Than Documented## Vulnerability Details **File Location**: `scripts/search_searx.sh`, lines 20 and 29–44 **Vulnerability Type**: Excessive Third-Party Search Query Disclosure **Risk Level**: Medium ### Complete Code Snippet ```bash # Extract HTTPS URLs from the JSON using node for accuracy. INSTANCES=($(echo "$INSTANCE_LIST" | node -e "const data = JSON.parse(require('fs').readFileSync(0, 'utf8')); const urls = Object.keys(data.instances || {}).filter(u => u.startsWith('https://')); console.log(urls.slice(0, 20).join('\n'));")) if [[ ${#INSTANCES[@]} -eq 0 ]]; then echo "未找到可用的 SearX 实例。" exit 1 fi fi MAX_ATTEMPTS=10 ATTEMPT=0 for URL in "${INSTANCES[@]}"; do ((ATTEMPT++)) if (( ATTEMPT > MAX_ATTEMPTS )); then break fi # Encode query for URL. ENCODED_QUERY=$(node -e "console.log(encodeURIComponent(process.argv[1]))" "$QUERY" 2>/dev/null) if [[ -z "$ENCODED_QUERY" ]]; then # Fallback: simple space replacement ENCODED_QUERY=$(echo "$QUERY" | sed 's/ /%20/g') fi SEARCH_URL="${URL%/}/search?q=${ENCODED_QUERY}&format=json" RESPONSE=$(curl -s -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "${SEARCH_URL}" 2>/dev/null) ``` ### Technical Analysis The Skill documentation states that searches retry using no more than three SearX instances. The implementation instead extracts up to 20 dynamically supplied HTTPS endpoints and configures a maximum of ten attempts. Each attempted request places the user-provided query in the URL query string and transmits it to a public, independently operated SearX server. An HTTPS URL protects the request while in transit, but the selected server can still observe and retain the search query, source IP address, user agent, request timing, and related network metadata. The registry is downloaded dynamically from `searx.space`, and the code accepts every listed URL that begins with `https://` without applying an operator allowlist or trust poli ...[truncated 1633 chars]
- Remediation
- ## Remediation Suggestions 1. Make implementation behavior match the documented three-instance limit: ```bash MAX_ATTEMPTS=3 ``` 2. Extract no more than three endpoints, or preferably choose them from a maintained allowlist of reviewed operators: ```javascript console.log(urls.slice(0, 3).join('\n')); ``` 3. Clearly disclose that queries and network metadata are sent to independently operated third-party SearX services. 4. Request explicit user confirmation before sending queries likely to contain personal, confidential, regulated, or credential-like data. 5. Apply a trust policy to registry entries rather than accepting every URL based solely on an `https://` prefix. Relevant criteria may include operator identity, privacy policy, logging policy, jurisdiction, and recent availability. 6. Add connection and total request timeouts to prevent unresponsive instances from delaying execution: ```bash curl --connect-timeout 5 --max-time 15 ... ``` 7. Enforce successful HTTP status handling with `--fail` or explicitly inspect `%{http_code}` before processing a response. This aligns implementation with the documented requirement that only HTTP 200 responses be accepted. 8. Consider using a single trusted search provider or a user-configured self-hosted SearX instance when search confidentiality is important.
