Skip to content

[codex] fix(gateway): default webhook listener to loopback#35206

Open
egilewski wants to merge 1 commit into
NousResearch:mainfrom
egilewski:codex/security-webhook-loopback-4260
Open

[codex] fix(gateway): default webhook listener to loopback#35206
egilewski wants to merge 1 commit into
NousResearch:mainfrom
egilewski:codex/security-webhook-loopback-4260

Conversation

@egilewski

@egilewski egilewski commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • default the generic webhook gateway listener to 127.0.0.1
  • keep explicit public binds available through platforms.webhook.extra.host: "0.0.0.0"
  • update webhook/SMS docs and stale test comments to reflect loopback defaults

Why

The webhook adapter previously defaulted to 0.0.0.0, so enabling the platform exposed configured webhook routes on every interface unless operators noticed and overrode the bind address. A loopback default makes direct network exposure an explicit deployment choice while still supporting tunnels, proxies, and intentionally public listeners.

Maintainer History

After opening this PR, I found the earlier rejected PR #4267. That PR changed both the SMS and generic Webhook adapters to default to 127.0.0.1; the Webhook hunk in this PR is materially the same default-host change. Teknium closed #4267 because SMS and Webhook adapters are inbound receivers for external services, and localhost defaults can break the out-of-the-box use case unless users run a tunnel or reverse proxy.

There is also later history in the other direction for SMS specifically: #19745 merged the SMS adapter default-host change to 127.0.0.1, preserving SMS_WEBHOOK_HOST=0.0.0.0 as the opt-in public-bind override. That later merged change covers SMS only. I did not find an equivalent later merged change for the generic Webhook adapter.

Given that history, this PR is intentionally explicit about the tradeoff: it asks whether the later SMS decision should also apply to the generic Webhook adapter, but it may still be rejected if maintainers consider #4267's Webhook rationale unchanged.

Fixes #4260.

Validation

  • git diff --check HEAD~1 HEAD
  • /home/mac/hermes-agent/.venv/bin/python -m py_compile gateway/platforms/webhook.py gateway/platforms/sms.py tests/gateway/test_webhook_adapter.py tests/gateway/test_sms.py tests/gateway/test_bluebubbles.py
  • direct constructor check that the default webhook host is 127.0.0.1 and explicit 0.0.0.0 is preserved
  • coderabbit review --agent --type committed reported 0 findings

Focused pytest collection for the webhook/SMS tests is blocked in this local venv because aiohttp is not installed.

The generic webhook adapter defaulted to 0.0.0.0, so enabling the platform exposed configured routes on every interface unless operators noticed and overrode the bind address. Default to 127.0.0.1 so network exposure is explicit through platforms.webhook.extra.host.

Preserve explicit public binds for deployments that intentionally expose the webhook listener behind a tunnel, proxy, or firewall.

Also correct SMS docs to match its existing loopback default.

Fixes NousResearch#4260.
@alt-glitch alt-glitch added type/security Security vulnerability or hardening P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/webhook Webhook / API server labels May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/webhook Webhook / API server type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: SMS and Webhook adapters bind to 0.0.0.0 by default

2 participants