Skip to content

Commit 2748166

Browse files
authored
fix: incomplete URL sanitization for Slack webhook detection (#2130)
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 7651752 commit 2748166

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scanpipe/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4843,7 +4843,8 @@ def deliver(self, pipeline_run, timeout=10):
48434843
logger.info(f"Webhook {self.uuid} is not active.")
48444844
return False
48454845

4846-
if "hooks.slack.com" in self.target_url:
4846+
parsed = urlparse(self.target_url)
4847+
if parsed.hostname == "hooks.slack.com":
48474848
payload = self.get_slack_payload(pipeline_run)
48484849
else:
48494850
payload = self.get_payload(pipeline_run)

0 commit comments

Comments
 (0)