{"id":"CVE-2024-43396","aliases":["CVE-2024-43396","GHSA-cf72-vg59-4j4h","PYSEC-2026-1492"],"related":[],"kind":"vulnerability","state":"published","title":"Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe Automation feature allows a user to insert arbitrary HTML inside the task instructions, resulting in a Stored XSS. \n\n### Details\nThe `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.\n\n### PoC\n```\nPOST /api/automation?q=%22%3E%3C%2Ftextarea%3E%3Cimg%20src%3Dx%20onerror%3Dalert(document.cookie)%3E%3Cscript%3Ealert(2)%3C%2Fscript%3E\n```\n\n### Impact\nStored XSS:\n![image](https://github.com/khoj-ai/khoj/assets/115566010/6b5b9f60-e05c-448b-82b4-bf010ad8a4f0)\n\n### Fix\n- Added a Content Security Policy to all config pages on the web client, including the automation page\n- Used DOM scripting to construct all components on the config pages, including the automation page","format":"markdown","source":"ghsa"},{"lang":"es","text":"Khoj es una aplicación que crea agentes personales de IA. La función de Automatización permite al usuario insertar HTML arbitrario dentro de las instrucciones de la tarea, lo que da como resultado un XSS almacenado. El parámetro q para el endpoint /api/automation no se desinfecta correctamente cuando se representa en la página, lo que da como resultado la capacidad de los usuarios de inyectar HTML/JS arbitrario. Esta vulnerabilidad se solucionó en 1.15.0.","source":"nvd"}],"published":"2024-08-20T19:59:32.000Z","modified":"2026-07-07T17:56:50.241Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 1.15.0","status":"affected"}],"vendor":"khoj-ai","product":"khoj","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.0"}],"ecosystem":"PyPI","package":"khoj","purl":"pkg:pypi/khoj","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.15.0"}],"vendor":"khoj","product":"khoj","cpe":"cpe:2.3:a:khoj:khoj:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.0"}],"ecosystem":"PyPI","package":"khoj","purl":"pkg:pypi/khoj","source":"pysec"}],"references":[{"url":"https://github.com/khoj-ai/khoj/security/advisories/GHSA-cf72-vg59-4j4h","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/khoj-ai/khoj/commit/1c7a562880eeb7354325545d2cf6c5d1d1134812","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/khoj-ai/khoj/commit/55be90cdd2f9d6a09c8bf9ceea52fc36b9201626","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-43396","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/khoj-ai/khoj","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/khoj","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-cf72-vg59-4j4h","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-08-21T19:52:22.737Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-43396","url":"https://www.cve.org/CVERecord?id=CVE-2024-43396","licence":"CVE Terms of Use","modified":"2024-08-21T19:52:35.357Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cf72-vg59-4j4h","url":"https://github.com/advisories/GHSA-cf72-vg59-4j4h","licence":"CC-BY-4.0","modified":"2026-07-07T17:56:50.241Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-43396","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-43396","licence":"Public domain","modified":"2026-06-17T07:50:58.010Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1492","url":"https://osv.dev/vulnerability/PYSEC-2026-1492","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:46.013Z"}],"updatedAt":"2026-11-25T22:58:44.600Z","epss":{"score":0.0055,"percentile":0.47411,"date":"2026-12-01T12:00:22.000Z"}}