Mask the http target's destination URL in the UI (closes #115)
All checks were successful
check / check (push) Successful in 4m17s

An http target's destination is frequently a Slack, Discord or
Teams incoming-webhook endpoint whose path segments are the
credential — the same property that made the Slack target's
webhook URL a bearer token. The source detail page rendered it
in full, so the leak closed for slack targets stayed reachable
through a different target type.

Render it through the existing MaskURL, which reduces a URL to
scheme and host. The field accepts an arbitrary URL, so no path
segment can be assumed non-secret and none is shown.
This commit is contained in:
2026-08-12 09:40:41 +00:00
parent d19e33671c
commit 5c0ea2b44f
3 changed files with 80 additions and 4 deletions

View File

@@ -106,6 +106,12 @@ func slackConfigFields(configJSON string) []ConfigField {
// and its retry settings. Header values are not shown — they
// routinely carry authorization tokens — only how many are
// configured.
//
// The destination is masked to scheme and host by the same
// rule the Slack target uses. An HTTP target's destination is
// commonly a Slack, Discord or Teams incoming-webhook endpoint
// whose path segments are the credential, and the field takes
// an arbitrary URL, so no segment can be assumed non-secret.
func httpConfigFields(t *database.Target) []ConfigField {
cfg, err := parseHTTPConfig(t.Config)
if err != nil {
@@ -114,7 +120,7 @@ func httpConfigFields(t *database.Target) []ConfigField {
fields := []ConfigField{{
Label: "Destination URL",
Value: cfg.URL,
Value: MaskURL(cfg.URL),
}}
if cfg.Timeout > 0 {