id: CVE-2024-21641

info:
  name: Flarum < 1.8.5 - Open Redirect
  author: kking
  severity: medium
  description: |
    Flarum is open source discussion platform software. Prior to version 1.8.5, the Flarum `/logout` route includes a redirect parameter that allows any third party to redirect users from a (trusted) domain of the Flarum installation to redirect to any link. For logged-in users, the logout must be confirmed. Guests are immediately redirected. This could be used by spammers to redirect to a web address using a trusted domain of a running Flarum installation.
  remediation: |
    The vulnerability has been fixed and published as flarum/core v1.8.5. As a workaround, some extensions modifying the logout route can remedy this issue if their implementation is safe.
  reference:
    - https://github.com/flarum/framework/security/advisories/GHSA-733r-8xcp-w9mr
    - https://github.com/flarum/flarum-core/commit/ee8b3b4ad1413a2b0971fdd9e40f812d2a3a9d3a
    - https://nvd.nist.gov/vuln/detail/CVE-2024-21641
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N
    cvss-score: 4.7
    cve-id: CVE-2024-21641
    cwe-id: CWE-601
    cpe: cpe:2.3:a:flarum:flarum:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: flarum
    product: flarum
    fofa-query: header="flarum_session="
    zoomeye-query: app="Flarum"
  tags: cve,cve2024,flarum,redirect

http:
  - method: GET
    path:
      - "{{BaseURL}}/logout?return=http://oast.pro"

    matchers-condition: and
    matchers:
      - type: regex
        part: header
        regex:
          - '(?m)^(?:Location\s*?:\s*?)(?:https?:\/\/|\/\/|\/\\\\|\/\\)(?:[a-zA-Z0-9\-_\.@]*)oast\.pro\/?(\/|[^.].*)?$'
          - "Set-Cookie: flarum_session="
        condition: and

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