Skip to content

Hardening: block SSRF to internal ranges on user-configured webhook/notification URLs #4383

Description

@Baymax-armed

Background

WebHookAlertNotifyHandlerImpl.send (hertzbeat-alerter/.../WebHookAlertNotifyHandlerImpl.java:42-72) issues a server-side POST to a user-supplied hookUrl (e.g. via POST /api/notice/receiver/send-test-msg) after only a non-blank check — no scheme or address filtering, and the outbound auth header is caller-controlled. The same pattern applies to other user-configurable webhook base URLs (Ntfy/Gotify).

I reported this privately to the ASF security team. They assessed it as within the documented trusted-user model (a URL configured by a highly-trusted user), so it is not a vulnerability, and suggested filing here as hardening.

Suggested hardening

  • Before sending, resolve the host and reject loopback / link-local (169.254.0.0/16, fe80::/10) / RFC-1918 / ULA addresses — check the resolved IP, and re-check on redirects.
  • Restrict the scheme to http/https.
  • Apply the same guard to the other user-set webhook base URLs.

Happy to send a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions