Validate Slack target URLs at creation time (SSRF parity with HTTP targets) #68
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the road to 1.0 (see #33).
HTTP delivery targets are validated at creation time by
delivery.ValidateTargetURL(called frominternal/handlers/source_management.go), which enforces an http/https scheme allowlist and blocks private, reserved, link-local, and cloud-metadata address ranges.buildSlackTargetConfigdoes not callValidateTargetURL, so a Slack target's incoming webhook URL is only checked by the request-time dialer guard, not at creation. That is an inconsistent, weaker gate for one target type.Definition of done:
ValidateTargetURL(or an equivalent) at creation time, matching the HTTP target pathImplementation instructions
Confine this change to
internal/handlers/source_management.goand its test file ONLY. Do NOT modifyinternal/delivery/— the validator already exists and is exported; just call it.The problem: HTTP targets are validated at creation by
delivery.ValidateTargetURL(defined ininternal/delivery/ssrf.go). The Slack target creation path (buildSlackTargetConfig/HandleTargetCreate) does not call it, so a Slack incoming-webhook URL is only checked at request time, not at creation.Fix:
delivery.ValidateTargetURLbefore persisting, mirroring the HTTP target pathDefinition of done:
handlerspackage covers both the accepted and rejected casesGates and process:
make fmtbefore committingdocker build .(must exit 0; host Go 1.25 vs go.mod 1.26, so Docker is the gate)mainnamedissue-68-slack-url-validation; commit subject ends with(closes #68)main) and comment on it with the diff summary and thedocker build .result