{"id":"CVE-2024-43396","aliases":["EUVD-2024-2558","GHSA-cf72-vg59-4j4h","PYSEC-2026-1492"],"status":"published","title":"Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)","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.","severity":{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.0055,"percentile":0.46292,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2024-08-20T19:59:32Z","modified":"2026-10-28T02:30:41Z","fixes":[{"ecosystem":"PyPI","package":"khoj","fixed_in":["1.15.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"khoj","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.15.0"}]}]},{"source":"osv","ecosystem":"PyPI","package":"khoj","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.15.0"}]}],"versions":["1.0"]},{"source":"osv","ecosystem":"PyPI","package":"khoj","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.15.0"}]}],"versions":["1.0"]}],"products":[{"vendor":"khoj","product":"khoj"},{"vendor":"khoj-ai","product":"khoj"}],"references":[{"url":"https://github.com/khoj-ai/khoj/security/advisories/GHSA-cf72-vg59-4j4h","tags":["x_refsource_CONFIRM","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/khoj-ai/khoj/commit/1c7a562880eeb7354325545d2cf6c5d1d1134812","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/khoj-ai/khoj/commit/55be90cdd2f9d6a09c8bf9ceea52fc36b9201626","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-43396","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-cf72-vg59-4j4h","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/43xxx/CVE-2024-43396.json","tags":["advisory"]},{"url":"https://github.com/khoj-ai/khoj","tags":["package"]},{"url":"https://pypi.org/project/khoj","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-43396","title":"Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)","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.","status":"published","published":"2024-08-20T20:23:05.66Z","modified":"2024-08-21T19:52:35.357Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:33:58.839967Z"}],"euvd":[{"id":"EUVD-2024-2558","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.","status":"published","published":"2024-08-20T20:23:05Z","modified":"2024-08-21T19:52:35Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-03T00:56:13.735057Z"}],"ghsa":[{"id":"GHSA-cf72-vg59-4j4h","title":"Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)","description":"### 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","status":"published","published":"2024-08-20T19:59:32Z","modified":"2024-08-21T14:53:27Z","cvss":[{"version":"4.0","score":5.3,"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","level":"medium"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:37:59.336921Z"}],"nvd":[{"id":"CVE-2024-43396","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.","status":"published","published":"2024-08-20T21:15:14.897Z","modified":"2026-06-17T07:50:58.01Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:10:19.870727Z"}],"osv":[{"id":"CVE-2024-43396","title":"Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)","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.","status":"published","published":"2024-08-20T20:23:05.66Z","modified":"2026-10-28T02:30:41.818074761Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:44:42.322107Z"},{"id":"GHSA-cf72-vg59-4j4h","title":"Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)","description":"### 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","status":"published","published":"2024-08-20T19:59:32Z","modified":"2026-07-07T17:56:50.241777115Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","level":"medium"},{"version":"4.0","score":5.3,"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","level":"medium"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:44.927642Z"},{"id":"PYSEC-2026-1492","title":"Khoj Vulnerable to Stored Cross-site Scripting In Automate (Preview feature)","description":"### 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","status":"published","published":"2026-07-07T14:34:39.002433Z","modified":"2026-07-07T17:46:46.013975103Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","level":"medium"},{"version":"4.0","score":5.3,"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","level":"medium"}],"updated_at":"2026-11-02T15:52:55.06457Z"}]}}
