Invia #994545: OctoPrint 1.0.0 Hardcoded Flask Secret Key leading to Session Forgery & Authentiinformazioni

TitoloOctoPrint 1.0.0 Hardcoded Flask Secret Key leading to Session Forgery & Authenti
DescrizioneVulnerability Description OctoPrint 1.0.0 uses a static, hardcoded Flask secret key for signing client-side session cookies. Due to the publicly known fixed key, attackers can forge valid signed session cookies with arbitrary user identity data, achieving full authentication bypass and obtaining administrator privileges on all affected instances. Technical Details Flask web framework stores session data on the client side and verifies integrity via HMAC signature using the server secret key. OctoPrint 1.0.0 hardcodes the secret key in the source code. All deployed instances share exactly the same secret key. Attackers can craft arbitrary authenticated session data, sign it with the public key, and bypass the entire login mechanism to become a valid administrator user. Affected Version OctoPrint 1.0.0 Problematic Code app.secret_key = "k3PuVYgtxNm8DXKKTw2nWmFQQun9qceV" Trigger Conditions 1. OctoPrint 1.0.0 service is running. 2. Network accessible. 3. No user interaction required. Proof of Concept from flask.sessions import SecureCookieSessionInterface from itsdangerous import URLSafeTimedSerializer SECRET_KEY = "k3PuVYgtxNm8DXKKTw2nWmFQQun9qceV" session_data = { "_user_id": "1", "identity.id": "octoprint", "identity.auth_type": "session" } serializer = URLSafeTimedSerializer(SECRET_KEY, salt="session") forged_session = serializer.dumps(session_data) print(forged_session) Using the forged session cookie can access all administrator-only interfaces. Fix Recommendation Remove hardcoded secret key. Generate a unique random secret key during first installation and store it in local secure configuration file with strict file permission. Rotate keys periodically and use server-side session storage.
Fonte⚠️ https://github.com/OctoPrint/OctoPrint
Utente
 Anonymous User
Sottomissione22/09/2026 19:01 (1 mese fa)
Moderazione24/10/2026 16:32 (1 month later)
StatoAccettato
Voce VulDB426129 [OctoPrint 1.0.0/1.1.0 Flask Secret Key cifratura debole]
Punti20

Do you want to use VulDB in your project?

Use the official API to access entries easily!