{"id":"GHSA-564j-v29w-rqr6","aliases":["GHSA-564j-v29w-rqr6"],"related":[],"kind":"vulnerability","state":"published","title":"Khoj Open Redirect Vulnerability in Login Page","summary":"### Summary\nAn 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.\nFor example, `https://app.khoj.dev/login?next=//example.com` will redirect to the https://example.com page.\n\n### Details\nThe problem seems to be in this method: https://github.com/khoj-ai/khoj/blob/2667ef45449eb408ce1d7c393be04845be31e15f/src/khoj/routers/auth.py#L95\n\n### PoC\nOpen the `https://app.khoj.dev/login?next=//example.com` url in a Gecko-based browser (Firefox).\n\n### Impact\nThe impact is low, and this could only be used in phishing attempts, but it's still a problem nonetheless.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### Summary\nAn 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.\nFor example, `https://app.khoj.dev/login?next=//example.com` will redirect to the https://example.com page.\n\n### Details\nThe problem seems to be in this method: https://github.com/khoj-ai/khoj/blob/2667ef45449eb408ce1d7c393be04845be31e15f/src/khoj/routers/auth.py#L95\n\n### PoC\nOpen the `https://app.khoj.dev/login?next=//example.com` url in a Gecko-based browser (Firefox).\n\n### Impact\nThe impact is low, and this could only be used in phishing attempts, but it's still a problem nonetheless.","format":"markdown","source":"ghsa"}],"published":"2024-07-08T14:57:43.000Z","modified":"2024-12-06T05:29:45.728Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:N/SI:H/SA:N","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:N/SI:H/SA:N","rating":"MEDIUM"}],"cwes":["CWE-601"],"affected":[{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.14.0"}],"ecosystem":"PyPI","package":"khoj-assistant","purl":"pkg:pypi/khoj-assistant","source":"ghsa"}],"references":[{"url":"https://github.com/khoj-ai/khoj/security/advisories/GHSA-564j-v29w-rqr6","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/khoj-ai/khoj/commit/4daf16e5f916641304e11d56a6071ad365c21a18","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/khoj-ai/khoj","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/khoj-ai/khoj/blob/2667ef45449eb408ce1d7c393be04845be31e15f/src/khoj/routers/auth.py#L95","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-564j-v29w-rqr6","url":"https://github.com/advisories/GHSA-564j-v29w-rqr6","licence":"CC-BY-4.0","modified":"2024-12-06T05:29:45.728Z"}],"updatedAt":"2026-11-25T22:56:34.035Z"}