other
- Location
scripts/search.py:20- Finding
Undisclosed External Transmission of User Search Queries
- Content
View full analysis
Vulnerability Details
File Location:
scripts/search.py:20, 211-239
Vulnerability Type: Undisclosed External Data Transmission
Risk Level: MediumVulnerable Code
python API_URL = "https://api.x.ai/v1/responses"python api_key = os.environ.get("XAI_API_KEY", "").strip() if not api_key: die("XAI_API_KEY environment variable is not set.") query = " ".join(w for w in options["query"] if w).strip() if not query: print("Error: No search query provided.", file=sys.stderr) print( 'Usage: python3 search.py [--handles h1,h2] [--exclude h1,h2] [--from YYYY-MM-DD] [--to YYYY-MM-DD] [--images] [--video] "<query>"', file=sys.stderr, ) sys.exit(1) body = json.dumps({ "model": MODEL, "input": [{"role": "user", "content": query}], "tools": [build_tool_config(options)], }).encode() req = Request( API_URL, data=body, headers={ "Content-Type": "application/json", "Authorization": f"Bearer {api_key}", "User-Agent": "OpenClaw/x-search", }, method="POST", ) opener = build_opener(_NoRedirect) try: with opener.open(req, timeout=TIMEOUT_S) as resp: data = json.loads(resp.read())Technical Analysis
The skill is declared in
SKILL.mdas a MegaETH development playbook, but the package also contains an X/Twitter search client that sends user-provided query text and search filters to the external xAI endpoint athttps://api.x.ai/v1/responses.The declared skill description does not disclose this X-search capability, its use of xAI, the
XAI_API_KEYrequirement, or the transfer of user input to an external service. Consequently, a user or agent relying on the declared scope may invoke behavior that transmits potentially sensitive text outside the local environment without informed consent.The API key is placed in the HTTPS authorization header and ...[truncated 1616 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
scripts/search.pyand its tests from this package if X/Twitter search is not required for the declared MegaETH functionality. - If the feature is intentional, move it into a separately declared and independently reviewed skill with a narrowly defined purpose.
- Clearly document:
- The destination service and endpoint.
- Every category of data transmitted, including query text, handles, date filters, and media-understanding options.
- The requirement for
XAI_API_KEY. - Relevant privacy, retention, and third-party processing implications.
- Require explicit user confirmation immediately before transmitting query data to xAI, showing the destination and a summary of the data being sent.
- Warn users not to submit credentials, private keys, seed phrases, internal source code, personal data, or other confidential content.
- Preserve the existing HTTPS-only endpoint and redirect-blocking behavior.
- Add tests verifying that no request occurs without explicit authorization and that credentials cannot be forwarded through redirects.
- Ensure the package manifest and documentation accurately describe every executable capability included in the distribution.
- Remove
