id: shibboleth-open-redirect

info:
  name: Shibboleth SSO - Open Redirect
  author: aushack
  severity: medium
  description: |
    Shibboleth SSO contains an open redirect vulnerability. An attacker can redirect a user to a malicious site and possibly obtain sensitive information, modify data, and/or execute unauthorized operations.
  remediation: |
    Set the redirectLimit option documented in the references.
  reference:
    - https://shibboleth.atlassian.net/wiki/spaces/SP3/pages/2065334342/Sessions
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 6.1
    cwe-id: CWE-601
  metadata:
    max-request: 1
    verified: true
    shodan-query: html:"Shibboleth"
  tags: redirect,shibboleth,misconfig,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/Shibboleth.sso/Logout?return=https://{{randstr}}.interact.sh"

    matchers-condition: and
    matchers:
      - type: regex
        part: header
        regex:
          - '(?m)^(?:Location\s*?:\s*?)(?:https?:\/\/|\/\/|\/\\\\|\/\\)(?:[a-zA-Z0-9\-_\.@]*)interact\.sh\/?(\/|[^.].*)?$' # https://regex101.com/r/L403F0/1

      - type: status
        status:
          - 302
# digest: 4a0a00473045022100d06495aca6005ef5dcb1b32804ab1fbfd051465530bf29f56812940542883cdf02204d098d2db16cd8083bd049349b6feac782758e754c4afb9db07b59a822bf2dff:922c64590222798bb761d5b6d8e72950