HexBrain

Browse / CVEs / CVE-2022-0437

CVE-2022-0437· karma project / karma· CWE-79

karma-runner DOM-based Cross-Site Scripting

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

NPM karma prior to 6.3.14. contains a DOM-based cross-site Scripting vulnerability.

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.

Fix

Upgrade to the latest version of karma-runner that includes proper input sanitization to mitigate this vulnerability.

How to confirm it

Send: GET {{BaseURL}}/karma.js ; GET {{BaseURL}}/?return_url=javascript:alert(document.domain)
Positive when: compare_versions(version, '< 6.3.14') AND contains in body_2 "Karma" AND status 200

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

The full check
id: CVE-2022-0437

info:
  name: karma-runner DOM-based Cross-Site Scripting
  author: pikpikcu
  severity: medium
  description: NPM karma prior to 6.3.14. contains a DOM-based cross-site Scripting vulnerability.
  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: |
    Upgrade to the latest version of karma-runner that includes proper input sanitization to mitigate this vulnerability.
  reference:
    - https://huntr.dev/bounties/64b67ea1-5487-4382-a5f6-e8a95f798885
    - https://github.com/karma-runner/karma/commit/839578c45a8ac42fbc1d72105f97eab77dd3eb8a
    - https://nvd.nist.gov/vuln/detail/CVE-2022-0437
    - https://github.com/karma-runner/karma
    - https://github.com/ARPSyndicate/cvemon
  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-0437
    cwe-id: CWE-79
    epss-score: 0.15054
    epss-percentile: 0.96754
    cpe: cpe:2.3:a:karma_project:karma:*:*:*:*:*:node.js:*:*
  metadata:
    max-request: 2
    vendor: karma_project
    product: karma
    framework: node.js
  tags: cve2022,cve,oss,huntr,karma,xss,karma_project,node.js,passive,vuln

http:
  - method: GET
    path:
      - '{{BaseURL}}/karma.js'
      - '{{BaseURL}}/?return_url=javascript:alert(document.domain)'

    matchers-condition: and
    matchers:
      - type: dsl
        dsl:
          - compare_versions(version, '< 6.3.14')

      - type: word
        part: body_2
        words:
          - 'Karma'

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        name: version
        group: 1
        regex:
          - "(?m)VERSION: '([0-9.]+)'"
        internal: true

References

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