id: slack-webhook-url

info:
  name: Slack Webhook URL
  author: Ice3man,DhiyaneshDK
  severity: info
  reference:
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/slack-webhook-url.go
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/slack-webhook-url.yaml
    - https://api.slack.com/messaging/webhooks
  metadata:
    max-request: 1
  tags: exposure,token,slack,vuln

flow: http(1) && http(2)

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    matchers:
      - type: regex
        part: body
        name: token
        regex:
          - 'https://hooks\\.slack\\.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'
          - '(https?:\/\/)?hooks.slack.com\/(services|workflows)\/[A-Za-z0-9+\/]{43,46}'
# digest: 4a0a00473045022053154eae5a9e67051cb9656d744d099e26ee58738bbeddd7ded2397a17b83f5e022100dbe0de402605de0dcb6ebd34e88fe21dd40f2418d200c96e4174571a70544bf9:922c64590222798bb761d5b6d8e72950