# Security posture of `plugin_webhook` This plugin makes outbound HTTP requests whose URL, headers and secret come from a user, and gives an agent a verb that fires them. That combination deserves an explicit statement of what is and is not possible. ## What the plugin can do | Capability | Detail | |---|---| | Outbound HTTP/HTTPS | one request per `webhook_trigger` (or test fire), method GET/POST/PUT/PATCH/DELETE/HEAD | | Arbitrary request headers | except `Host`, `Content-Length`, `Transfer-Encoding`, `Connection` | | HMAC-SHA256 signing | `github`, `gitlab` shared-token and timestamped `v2` | | Read one file | its own store (`hooks.json`) | | Write one file | the same store, plus its `.tmp` sibling, at mode 0600 | | Read the node clock | only to stamp the `v2` signature and the delivery log | ## What it cannot do - **Run a program.** There is no `system()`, no `popen()`, no `exec*()` anywhere in the source; `tests/run.sh` greps for all three and fails the build. - **Read another file.** The store path is the only path opened for write; the only other paths read are the TLS CA bundles. - **Reach a private address by accident.** Every address a hostname resolves to is checked against loopback / RFC1918 / link-local / CGNAT / ULA / multicast / documentation ranges *before* a socket is opened. `WEBHOOK_ALLOW_PRIVATE=1` is the only way through, and it is a deliberate operator action on a node the operator controls. - **Follow a redirect.** A 3xx is reported as its status. Following one would mean a hook definition silently becomes a request to somewhere the operator never configured - and the second hop would be the one carrying the secrets. - **Send over unverified TLS.** `MBEDTLS_SSL_VERIFY_REQUIRED`, TLS 1.2 minimum, hostname checked against the certificate, anchors from `WEBHOOK_TLS_CA_FILE` or the system bundle. There is no insecure flag in the source to turn on. - **Leak a secret to the agent or the browser.** Every serializer that faces an MCP client or a CGI response emits header *names* and `has_secret`; the HMAC emits its scheme and `has_secret`. The store document itself is the only place a value exists, and it is mode 0600. ## Threats and the answer **Prompt injection turns the agent into an exfiltration tool.** The agent can only name a hook (`webhook_list` reported the names). It cannot set a URL, a header or a secret, and it cannot read them back. The worst it can do with a hostile instruction is send a payload to an endpoint the operator already trusts. **A pasted URL contains a provider token.** `webhook_list` redacts the query string by default (`?`), so a Slack or Zapier URL pasted into the form does not put its token into a transcript. `redact_url: false` is available and documented as the risky choice. **DNS rebinding to a private address.** The check runs on the *numeric* answers of the lookup, all of them, not on the hostname. On POSIX the connection is then made to that validated numeric address, so a second lookup after the check cannot change where the bytes go. On Windows the request must go to the real hostname instead - WinHTTP takes both SNI and the certificate hostname it verifies from the name given to `WinHttpConnect()`, so connecting by IP would break verification for every ordinary name-based certificate - and the protection there is the all-answers check plus verified TLS, which refuses a certificate issued for a public name when the peer is a private host that cannot present one. **Request splitting.** A header value containing CR or LF is refused at save time (`value` validation) and again at request time (`wh_http.c` skips framing headers and writes headers from validated names). **Replay of a captured request.** Body-only signatures are not offered. `v2` signs `"." + body`, so a verifier that keeps a time window rejects a replayed request. **A corrupt store eating the secrets.** The document is written to `.tmp` and `rename()`d, and a store that fails to parse is *reported and left untouched* - the plugin never rewrites a file it could not read. **A runaway response.** Bodies are capped at 4 KiB of preview with an 8 MiB drain ceiling, an outbound body at 1 MiB, and every connect/read phase has a deadline. ## The auth gate The CGI page and every `?action=` route call `require_node_auth()` - the page lists endpoint URLs, so it is node-private data. `--meta`, `--schema` and `--mcp` return *before* the gate: discovery and the tool surface must work on a locked node, and neither reveals a hook. ## Reporting Open an issue at `https://plugingit.scorpiox.net/repo?name=scorpiox-bot-plugin-webhook`, or contact SCORPIOX INC directly for anything you would rather not describe in public.