{"answers":{"affected":"3 open source packages ship an affected version, including khoj. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-43396 in the wild and no public exploit code.","fix":"Upgrade khoj to 1.15.0 or later.","what":"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."},"fix_prompt":"Check this codebase for CVE-2024-43396 and fix it if it is affected.\n\nWhat it is: 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.\nExploitation: There is no known exploitation of CVE-2024-43396 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- khoj (PyPI): affected all versions; fixed in 1.15.0\n- khoj (PyPI): affected all versions; fixed in 1.15.0\n- khoj (PyPI): affected all versions; fixed in 1.15.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-43396/ (Markdown: https://insights.sbomify.com/CVE-2024-43396/index.md)","id":"CVE-2024-43396","markdown":"https://insights.sbomify.com/CVE-2024-43396/index.md","name":"CVE-2024-43396","record":{"aliases":["GHSA-cf72-vg59-4j4h","PYSEC-2026-1492"],"analysis":{"component_type":"web_application","fix_type":"upgrade","impacts":["code_execution","account_takeover"],"network_reachable":"yes","non_default_config":true,"product_category":"AI agent application","requires_auth":"none","summary":"Attackers can inject arbitrary HTML/JS via task instructions in the Automation feature, leading to stored XSS and potential account takeover.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"khoj","vendor":"khoj"}],"cvss":{"score":5.4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)","id":"CVE-2024-43396","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"xss","year":"2024"},"n_packages":3,"n_references":3,"next":{"headline":"Potential unauthorized access issue in apollo-portal","id":"CVE-2024-43397"},"packages":[{"ecosystem":"PyPI","fixed":["1.15.0"],"introduced":["0"],"last_affected":[],"package":"khoj","purl":null,"source":"GHSA-cf72-vg59-4j4h"},{"ecosystem":"PyPI","fixed":["1.15.0"],"introduced":["0"],"last_affected":[],"package":"khoj","purl":"pkg:pypi/khoj","source":"GHSA-cf72-vg59-4j4h"},{"ecosystem":"PyPI","fixed":["1.15.0"],"introduced":["0"],"last_affected":[],"package":"khoj","purl":"pkg:pypi/khoj","source":"PYSEC-2026-1492"}],"prev":{"headline":"CraftOS-PC 2's improperly sanitizied paths cause filesystem escape (Windows)","id":"CVE-2024-43395"},"products":["khoj"],"published":"2024-08-20","related":[{"cvss_score":5.9,"headline":"Prompt Injection triggered XSS vulnerability in Khoj Obsidian, Desktop and Web clients","id":"CVE-2024-25639","kev_date_added":null,"published":"2024-07-08"},{"cvss_score":5.4,"headline":"Khoj has an IDOR in Notion OAuth Flow Enables Index Poisoning","id":"CVE-2025-69207","kev_date_added":null,"published":"2026-02-02"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-21","vendors":["khoj-ai"]},"summary":"Attackers can inject arbitrary HTML/JS via task instructions in the Automation feature, leading to stored XSS and potential account takeover.","url":"https://insights.sbomify.com/CVE-2024-43396/"}