Cyber Resilience

CVE-2024-25639

RCE in Khoj ≤ 1.13.0

Published
08 July 2024
Modified
21 November 2024
Patch / advisory
CVSS Score v3.1 5.9
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L
EPSS Score 0.0057 44th percentile
Risk Priority 46 floored blend · peak EPSS

Summary

CVE-2024-25639 is a medium-severity Basic XSS (CWE-80) vulnerability in Khoj Khoj. Its CVSS base score is 5.9 (Medium).

Operationally, exploitation aligns with the MITRE ATT&CK technique Command and Scripting Interpreter (T1059); ranked at the 44th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

This vulnerability is AI-related — categorised as LLM Application Platforms; in the LLM/Generative AI Risks risk domain.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

Khoj is an application that creates personal AI agents. The Khoj Obsidian, Desktop and Web clients inadequately sanitize the AI model's response and user inputs. This can trigger Cross Site Scripting (XSS) via Prompt Injection from untrusted documents either indexed…

more

by the user on Khoj or read by Khoj from the internet when the user invokes the /online command. This vulnerability is fixed in 1.13.0.

CWE(s)

AI Security AnalysisAI

AI Category
LLM Application Platforms
Risk Domain
LLM/Generative AI Risks
OWASP Top 10 for LLMs 2025
None mapped
AI-specific weaknesses CR
  • CWE-1427 — Prompt injection from untrusted docs + unsanitized model output to XSS sink
Mapped by Cyber Resilience · not in NVD. Poisoning and extraction cases are routed to MITRE ATLAS instead of a synthetic CWE.
Classification Reason
Matched keywords: ai, ai, prompt injection

Related Threats

MITRE ATT&CK Enterprise Techniques

T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1185 Browser Session Hijacking Collection
Adversaries may take advantage of security vulnerabilities and inherent functionality in browser software to change content, modify user-behaviors, and intercept information as part of various browser session hijacking techniques.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1539 Steal Web Session Cookie Credential Access
An adversary may steal web application or service session cookies and use them to gain access to web applications or Internet services as an authenticated user without needing credentials.
T1659 Content Injection Initial Access
Adversaries may gain access and continuously communicate with victims by injecting malicious content into systems through online network traffic.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-41611Shared CWE-77, CWE-79
CVE-2023-0776Shared CWE-77, CWE-79
CVE-2024-33113Shared CWE-77, CWE-79
CVE-2024-28739Shared CWE-77, CWE-79
CVE-2025-50891Shared CWE-77, CWE-79
CVE-2025-49833Shared CWE-77
CVE-2025-49834Shared CWE-77
CVE-2026-4399Shared CWE-77
CVE-2025-34267Shared CWE-77
CVE-2025-57164Shared CWE-77

Affected Assets

khoj
khoj
≤ 1.13.0

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V1.2.3
  • V1.2.5
  • V1.2.8
  • V1.2.9

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation can discover missing or incorrect neutralization of script tags through targeted XSS test cases.

Input validation explicitly requires checking and neutralizing untrusted web inputs containing script-related characters before they reach a downstream renderer.

Output filtering can catch or sanitize unneutralized script content before it is served to users.

Secure engineering principles include mandatory output encoding and neutralization of HTML metacharacters to stop injection at the source.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly require output encoding and input validation that prevent basic XSS.

DE.CM-09 partial match
prevents

Runtime monitoring of software and data can detect anomalous command execution resulting from injection.

ID.RA-01 partial match
prevents

Identifying recorded vulnerabilities enables remediation of command-injection flaws before exploitation.

PR.PS-02 partial match
prevents

Patching and EOL replacement can remediate known XSS instances in libraries or frameworks (partial) but do nothing to enforce input neutralization in application code (none).

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

prevents

Secure coding standards require proper escaping and parameterization of commands, directly eliminating CWE-77.

finds

Security testing in development catches unneutralized script tags before release.

prevents

Knowledge exchange on emerging attack techniques and patches reduces the likelihood that cross-site scripting flaws remain unaddressed in deployed applications.

prevents

Operational indicators of compromise for web-application attacks can be incorporated into WAF or input-filtering rules, lowering the likelihood that unsanitized data reaches the browser.

prevents

Secure SDLC mandates input validation and output encoding that directly prevent basic XSS.

prevents

Application security requirements explicitly call for neutralization of script-related HTML tags.

References