plugin_websearch makes outbound requests and holds your API keys. Two
questions matter, and this file answers both precisely:
There is no filesystem write outside the one config file, no process spawning, and
no inbound listener: it is a CGI program and an MCP stdio server.
Exactly one kind of outbound request: an HTTPS exchange with the search backend that
is currently active.
| Backend | Request | Credential sent |
|---|---|---|
duckduckgo | POST {base}/html/ (form body) | none |
searxng | GET {base}/search?format=json | none (a self-hosted URL may carry its own auth in the URL — your choice, it is not added by this plugin) |
brave | GET {base}/res/v1/web/search | X-Subscription-Token: <key> |
tavily | POST {base}/search | Authorization: Bearer <key> |
exa | POST {base}/search | x-api-key: <key> |
perplexity | POST {base}/search | Authorization: Bearer <key> |
Your query goes to that backend. That is what a search tool is for; it is stated
here so it is never a surprise. Nothing else is transmitted — no session content, no
hostname, no username, no node id.
Base URLs are operator-supplied (config or environment) and must start with http://
or https://; anything else is refused at save time and by the URL parser. A URL
with userinfo@ is refused by the parser, and a host containing anything outside
[A-Za-z0-9.-] is refused too, so a crafted base cannot smuggle a different host or a
shell fragment.
The transport is the SCORPIOX BOT Connector SDK's HTTP/1.1 + TLS client, vendored:
src/ca_roots_pem.h (compiled in) plus any operator bundle via SX_CA_BUNDLE, hostname checked against the certificate.
parameter that reaches it. The single escape hatch is the environment variable
SX_TLS_INSECURE=1, which is documented as debug-only and is logged loudly.
libcurl, no OpenSSL, no system CA file is required at runtime — there isnothing on the host that can be swapped underneath the binary to weaken it.
the response body is capped, so a hostile server cannot hang the plugin or exhaust
memory.
~/.scorpiox/connectors/plugin_websearch/config.json (or
/workspace/.scorpiox/connectors/plugin_websearch/config.json on BotCloud),
mode 0600, written atomically (temp file → rename). The directory is chosen
deliberately outside the plugin's own directory so a plugin update cannot take the
keys with it.
learn has_key: true|false.
type="password", they are cleared after a save, and theserverside never echoes a key back into the HTML.
clear_<provider>_key field, so "I tabbed past the box" cannot silently unset it.
tests/run.sh asserts that neither the save response, the providers response, northe page markup contains the key that was just written.
The node API's :8150 is LAN-reachable, so the page and the JSON API are gated:
X-Bot-Password: <pwd>, Authorization: Bearer <pwd>, ?pwd=<pwd> (the last one is what the bot's plugin iframe appends).
BOT_PASSWORD is unset the gate is a no-op — that is the node's own policy, notthis plugin's.
--meta and --mcp return before the gate: discovery (/plugins) and the sx-connector-mcp router must work without a password, and neither answers a web
request.
tests/run.sh proves a bare GET is 401 while a set node password is configured.
DuckDuckGo has no API, so its result page is parsed. That page is the only
attacker-influenced markup in the tree, and it is treated accordingly:
<script>/<style> content wholesale (a page's inline JS mustnever arrive as "result text" in the model's context), and decodes HTML entities to
UTF-8 rather than guessing a single byte.
a control byte or a \u0000 in a title cannot break the document or truncate a
field.
/l/?uddg=…) are unwrapped by percent-decoding, and only http(s) results are kept as links.
results" — a search that silently returns nothing for months is the failure mode
this avoids.
grep -E '\b(popen|system|execv|fork)\s*\(' over src/returns nothing, and the suite fails if it ever does.
config.json (written temp → rename).backend.**
request, so "what did it fetch" is never an archaeological question.
This is an open-source plugin on plugingit.scorpiox.net — the whole history, every
commit and the source.tar.gz behind every published binary are public and auditable
(scorpiox-cli-botplugin audit scans the full history for credentials and private
addresses before each publish).