CVE-2024-43396 Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)
Attackers can inject arbitrary HTML/JS via task instructions in the Automation feature, leading to stored XSS and potential account takeover.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-43396?
CVE-2024-43396 is a medium-severity cross-site scripting vulnerability in khoj-ai khoj, published on 20 Aug 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Khoj is an application that creates personal AI agents. The Automation feature allows a user to insert arbitrary HTML inside the task instructions, resulting in a Stored XSS. The q parameter for the /api/automation endpoint does not get correctly sanitized when rendered on the page, resulting in the ability of users to inject arbitrary HTML/JS. This vulnerability is fixed in 1.15.0.
Weakness: CWE-79
Which versions are affected by CVE-2024-43396?
3 open source packages ship an affected version, including khoj. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
khoj PyPI | All versions | 1.15.0 |
khoj PyPI | All versions | 1.15.0 |
khoj PyPI | All versions | 1.15.0 |
Products include Khoj Khoj.
How do I fix CVE-2024-43396?
Upgrade khoj to 1.15.0 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2024-43396 being exploited?
There is no known exploitation of CVE-2024-43396 in the wild and no public exploit code.
Other vulnerabilities in khoj-ai khoj
Sources
Also known as GHSA-cf72-vg59-4j4h, PYSEC-2026-1492.