PyPi: Khoj

CVE-2024-25639

Safety vulnerability ID: 72210

This vulnerability was reviewed by experts

The information on this page was manually curated by our Cybersecurity Intelligence Team.

Created at Jul 08, 2024 Updated at Feb 18, 2025
Scan your Python projects for vulnerabilities →

Advisory

In affected versions of Khoj, both the Obsidian desktop and web clients fail to properly sanitize inputs from the AI model's responses and user inputs. This oversight can lead to Cross-Site Scripting (XSS) attacks via prompt injection, particularly when untrusted documents indexed by users within Khoj or retrieved from the internet trigger the /online command.

Affected package

khoj

Latest version: 1.36.6

Your Second Brain

Affected versions

Fixed versions

Vulnerability changelog

🎁 New
* Allow using Anthropic models like Claude by sabaimran in https://github.com/khoj-ai/khoj/pull/760
* Make Automations Shareable by sabaimran in https://github.com/khoj-ai/khoj/pull/790

🧪 Improve
* **Upgrade Khoj Obsidian UX**: Chat from Side Pane, Support Multiple Conversations by debanjum in https://github.com/khoj-ai/khoj/pull/736
* Improve Command Menu and Help Command by MythicalCow in https://github.com/khoj-ai/khoj/pull/774
* Improve Documentation to set up Khoj for Development by MythicalCow in https://github.com/khoj-ai/khoj/pull/768

⚒️ Fix
* Enforce CSP & sanitize AI generated chat responses to **prevent XSS via Prompt Injection**
* Uncovered by calligraf0 ❤️ in [CVE-2024-25639](https://github.com/khoj-ai/khoj/security/advisories/GHSA-h2q2-vch3-72qm)
* Fixed by debanjum in b757ba664f7dc69b174e8e94deaa0e79414e2c46, 9f80c2ab76005dd7e51a7886007d09537f6c2483
* Open external links in an external browser from the Khoj desktop app in 7b18919564a420ed578dded0dd5ac85891d66ad5

**Full Changelog**: https://github.com/khoj-ai/khoj/compare/1.12.1...1.13.0

Resources

Use this package?

Scan your Python project for dependency vulnerabilities in two minutes

Scan your application

Severity Details

CVSS Base Score

HIGH 7.5

CVSS v3 Details

HIGH 7.5
Attack Vector (AV)
NETWORK
Attack Complexity (AC)
HIGH
Privileges Required (PR)
NONE
User Interaction (UI)
REQUIRED
Scope (S)
UNCHANGED
Confidentiality Impact (C)
HIGH
Integrity Impact (I)
HIGH
Availability Availability (A)
HIGH