MEDIUM 5.5

CVE-2026-13508: Khoj AI Conversation Authorization Bypass (CVSS 5.5)

Khoj AI's conversational search platform contains an authorization bypass vulnerability in its conversation sharing feature. By manipulating the conversation.agent parameter, an authenticated user can gain inappropriate access to conversations they shouldn't be able to view or modify. The vulnerability affects Khoj up to version 2.0.0-beta.28 and can be exploited remotely without additional privileges beyond basic authentication. A fix has been proposed but not yet merged into the codebase.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.5 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
Weaknesses (CWE)
CWE-285, CWE-863
Affected products
0 configuration(s)
Published / Modified
2026-06-28 / 2026-06-29

NVD description (verbatim)

A flaw has been found in khoj-ai khoj up to 2.0.0-beta.28. This impacts an unknown function of the file src/khoj/routers/api_chat.py of the component Conversation Sharing Handler. This manipulation of the argument conversation.agent causes incorrect authorization. Remote exploitation of the attack is possible. The exploit has been published and may be used. The pull request to fix this issue awaits acceptance.

7 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-13508 is an authorization flaw in the Conversation Sharing Handler within src/khoj/routers/api_chat.py. The vulnerability stems from improper authorization checks when processing the conversation.agent argument. An authenticated attacker can manipulate this parameter to bypass access controls, allowing them to read or modify conversation data they lack permission to access. The issue is classified under CWE-285 (Improper Authorization) and CWE-863 (Incorrect Authorization), indicating a fundamental gap in the application's permission enforcement logic. Remote exploitation is possible without elevated privileges.

Business impact

For organizations deploying Khoj as an internal knowledge assistant or customer-facing conversational interface, this vulnerability enables data exfiltration and manipulation of sensitive discussions. Authenticated users—including contractors, former employees with lingering access, or compromised internal accounts—could access confidential conversations, retrieve proprietary information, or inject malicious responses into shared conversations. In multi-tenant or BYOK (Bring Your Own Knowledge) scenarios, the blast radius expands to customer data. While the CVSS score of 5.5 reflects moderate severity, the confidentiality and integrity impact warrants immediate attention, especially if Khoj processes regulated information (healthcare, legal, financial discussions).

Affected systems

Khoj AI's khoj product is affected in all versions up to and including 2.0.0-beta.28. The vulnerability exists in the conversation API router and impacts any deployment where conversation sharing is enabled or accessible to multiple users. This includes self-hosted instances, cloud deployments, and any integration where the Khoj API is exposed to authenticated users.

Exploitability

The vulnerability is exploitable by any authenticated user with network access to the Khoj API endpoint. No special privileges, elevated credentials, or user interaction is required beyond the initial authentication. The attack surface is broad because the flaw resides in a core API router. Public disclosure of an exploit means adversaries have functional proof-of-concept code; however, the requirement for prior authentication limits blast radius compared to unauthenticated exploits. Organizations should assume malicious insiders or accounts compromised through phishing are immediate threats.

Remediation

Update Khoj to a patched version once released and the pending pull request is merged. Immediately after patching, audit conversation access logs to detect unauthorized access during the vulnerability window. Implement network segmentation to restrict API access to trusted networks. Review user access permissions and revoke credentials for accounts that are no longer needed. If a patch is not yet available, consider temporarily disabling conversation sharing features or restricting API access to a whitelist of known-safe client applications until a fix is deployed.

Patch guidance

Monitor the Khoj project repository and official advisories for a release that addresses this CVE. The fix is currently pending in a pull request, so verify the merged version number against the vendor's security advisory or release notes before deploying. Once a patched version is available, apply it across all Khoj instances in your environment. Test the patch in a staging environment to ensure conversation sharing and agent manipulation are properly restricted. Verify that legitimate users retain expected access permissions after patching.

Detection guidance

Monitor API access logs for repeated or suspicious calls to the conversation endpoints (src/khoj/routers/api_chat.py) with varying conversation.agent parameter values, particularly from a single user account accessing conversations outside their normal scope. Set alerts for authentication tokens being used to access conversations that don't match the token's assigned scope. Review conversation access patterns for anomalies such as bulk exports, rapid sequential access to multiple conversations, or access to conversations from different organizational units or teams. Implement API request logging that captures the conversation.agent parameter values to establish a baseline of normal behavior.

Why prioritize this

Although the CVSS score is moderate (5.5), the vulnerability should be prioritized due to the published exploit, the direct impact on data confidentiality and integrity, and the low barrier to exploitation (requires only authentication, which is abundant in most organizations). This is especially critical if Khoj is used to process or store sensitive business information, customer data, or regulated content. The attack surface is the API router itself, making it a likely target for compromise post-initial breach or insider threat scenarios.

Risk score, explained

The CVSS 3.1 score of 5.5 (MEDIUM) reflects: Network-accessible attack vector (AV:N), low attack complexity (AC:L), requiring low privileges—authenticated access (PR:L), and requiring user interaction (UI:R). The impact is limited to low confidentiality, low integrity, and low availability loss. The moderate score appropriately captures that an attacker needs to authenticate and trigger the action, but underweights the insider threat and post-compromise scenarios where this flaw becomes critical. Organizations handling sensitive conversations should treat this above its numerical score.

Frequently asked questions

Is this vulnerability being actively exploited in the wild?

The vulnerability has public exploit code available. While it is not currently listed on CISA's Known Exploited Vulnerabilities catalog, the published nature of the exploit means it is accessible to potential attackers. Organizations should assume that threat actors are aware of and testing this flaw.

Does Khoj provide a timeline for a patch?

The vulnerability description indicates a pull request is pending acceptance. Patch availability has not been confirmed in the provided data. Check the official Khoj repository, security advisories, and GitHub pull requests for the most current status and expected release date.

What's the difference between this CWE-285 and CWE-863 classification?

CWE-285 (Improper Authorization) is the broader category describing the failure to enforce proper permissions. CWE-863 (Incorrect Authorization) narrows the focus to scenarios where authorization logic is present but flawed—in this case, the conversation.agent parameter manipulation bypasses the intended check. Both apply here because the authorization mechanism is both absent and incorrectly implemented.

Can I mitigate this without patching if Khoj is internal-only?

Internal-only deployment reduces risk by limiting the attacker pool to employees and contractors with VPN/network access. However, this does not eliminate the threat from compromised internal credentials or malicious insiders. Temporary mitigation includes disabling conversation sharing, restricting API access to a whitelist, and enforcing strict monitoring. However, patching is the only durable solution.

This analysis is based on publicly available vulnerability data and published CVE details as of June 2026. Patch availability, timelines, and vendor responses may change. Organizations must verify patch versions, vendor advisories, and compatibility before deployment. No exploit code is provided or endorsed by SEC.co. This assessment is for informational purposes and does not constitute professional security advice for your specific environment. Consult with your security team and vendor for customized remediation guidance. Source: NVD (public-domain), retrieved 2026-08-07. Analysis generated by SEC.co (claude-haiku-4-5).