other
- Location
scripts/search_searx.sh:20- Finding
Search Queries Are Disclosed to More Third-Party Instances Than Documented
- Content
View full analysis
Vulnerability Details
File Location:
scripts/search_searx.sh, lines 20 and 29–44
Vulnerability Type: Excessive Third-Party Search Query Disclosure
Risk Level: MediumComplete 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 withhttps://without applying an operator allowlist or trust poli ...[truncated 1633 chars]- Remediation
View remediation
Remediation Suggestions
- Make implementation behavior match the documented three-instance limit:
bash MAX_ATTEMPTS=3- 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'));-
Clearly disclose that queries and network metadata are sent to independently operated third-party SearX services.
-
Request explicit user confirmation before sending queries likely to contain personal, confidential, regulated, or credential-like data.
-
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. -
Add connection and total request timeouts to prevent unresponsive instances from delaying execution:
bash curl --connect-timeout 5 --max-time 15 ...-
Enforce successful HTTP status handling with
--failor explicitly inspect%{http_code}before processing a response. This aligns implementation with the documented requirement that only HTTP 200 responses be accepted. -
Consider using a single trusted search provider or a user-configured self-hosted SearX instance when search confidentiality is important.
