You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Khoj Open Redirect Vulnerability in Login Page
Moderate severity
GitHub Reviewed
Published
Jul 8, 2024
in
khoj-ai/khoj
•
Updated Aug 7, 2024
An attacker can use the next parameter on the login page to redirect a victim to a malicious page, while masking this using a legit-looking app.khoj.dev url.
For example, https://app.khoj.dev/#?next=//example.com will redirect to the https://example.com page.
Summary
An attacker can use the
next
parameter on the login page to redirect a victim to a malicious page, while masking this using a legit-lookingapp.khoj.dev
url.For example,
https://app.khoj.dev/#?next=//example.com
will redirect to the https://example.com page.Details
The problem seems to be in this method: https://github.com/khoj-ai/khoj/blob/2667ef45449eb408ce1d7c393be04845be31e15f/src/khoj/routers/auth.py#L95
PoC
Open the
https://app.khoj.dev/#?next=//example.com
url in a Gecko-based browser (Firefox).Impact
The impact is low, and this could only be used in phishing attempts, but it's still a problem nonetheless.
References