Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS01NjRqLXYyOXctcnFyNs4AA9n4

Khoj Open Redirect Vulnerability in Login 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-looking app.khoj.dev url.
For example, https://app.khoj.dev/login?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/login?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.

Permalink: https://github.com/advisories/GHSA-564j-v29w-rqr6
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS01NjRqLXYyOXctcnFyNs4AA9n4
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 2 months ago
Updated: about 1 month ago


CVSS Score: 6.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

Identifiers: GHSA-564j-v29w-rqr6
References: Repository: https://github.com/khoj-ai/khoj
Blast Radius: 0.0

Affected Packages

pypi:khoj-assistant
Dependent packages: 0
Dependent repositories: 1
Downloads: 15,252 last month
Affected Version Ranges: < 1.14.0
Fixed in: 1.14.0
All affected versions: 0.1.0, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10, 0.2.0, 0.2.1, 0.2.5, 0.2.6, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.10.0, 0.10.1, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4, 0.12.0, 0.12.1, 0.12.2, 0.12.3, 0.13.0, 0.14.0, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.8.0, 1.9.0, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.11.1, 1.11.2, 1.12.0, 1.12.1, 1.13.0
All unaffected versions: 1.14.0, 1.15.0, 1.16.0, 1.21.0, 1.21.1