Critical full compromise of jarvis-new.urbanclap.com via weak session signing
The Flask session signing key was weak, allowing an attacker to forge session cookies and password reset tokens. This enabled logging in as any user, including an administrator, resulting in full compromise of the Redash instance.
- Triaged in under an hour
- Fixed in 17 hours
- Paid in 17 hours
- Disclosed after 3 months
Summary
Hi there, I discovered that jarvis-new.urbanclap.com uses a weak Flask session key. Because Flask sessions are signed with a static secret, if this secret is known to an attacker then they can modify the session state. In this case, we can modify the Redash user_id for the session and log in as any user. This results in a full compromise of the instance. I have attached a screenshot showing that I logged into █████████@urbancompany.com and have full admin permissions:
██████████ ████ ██████████ ███████
How to fix
Change the REDASH_COOKIE_SECRET and REDASH_SECRET_KEY to a random value immediately.
PoC
For simplicity, it is easiest to forge a password reset link for Redash. We can do this with a bit of Python. To get the reset link for user ID 1, we simply run:
>>> from itsdangerous import URLSafeTimedSerializer, SignatureExpired, BadSignature
>>> serializer = URLSafeTimedSerializer("███")
>>> serializer.dumps(str("1"))
'███'
Then, we can browse to https://jarvis-new.urbanclap.com/reset/█████ and choose a new password for user ID 1. This then logs us into their account.
Impact
Since this is connected to all of your databases, this is likely a significant leak of PII and other sensitive information. This is easily a critical issue.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Flask session secret key was weak or guessable, allowing an attacker to sign arbitrary session data.
Impact
An attacker could log in as any user, including an administrator, leading to a significant leak of PII and other sensitive information from connected databases.
What the attacker needed
Knowledge of the weak secret key
The fix
The secret keys should be changed to random values immediately.
How it was found
- Use a Python script to forge a password reset token for user ID 1.
- Visit the reset link and set a new password for that user.
- Log in as the user with the new password.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A session cookie is like a wristband that proves you are logged in. The server signs it with a secret key so you cannot change it. Here the key was weak, so the attacker could make their own valid wristband for any user, including an admin.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.