/

CVE-2026-111702

Severity:

HIGH RISK

(7.5)

IDOR (CWE-639) in ChatOllama Knowledge Base Access APIs

CVE-2026-111702

Deferred

Vulnerability type

Category:

Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Unauthorized Access to Private Data

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

ChatOllama contains an insecure direct object reference vulnerability that may let remote attackers access private knowledge bases belonging to other users. By supplying sequential knowledge-base identifiers through exposed API endpoints, an attacker could retrieve metadata and document content when authorization checks do not verify ownership.

ChatOllama contains an insecure direct object reference vulnerability that may let remote attackers access private knowledge bases belonging to other users. By supplying sequential knowledge-base identifiers through exposed API endpoints, an attacker could retrieve metadata and document content when authorization checks do not verify ownership.

Affected context

The issue occurs in ChatOllama API workflows that retrieve knowledge bases by numeric or otherwise predictable identifiers. It becomes risky when the application accepts a caller-supplied identifier through GET /api/knowledgebases/{id} or the knowledgebaseId parameter of POST /api/models/chat without consistently checking whether the requesting user is authorized to access the referenced resource.

The issue occurs in ChatOllama API workflows that retrieve knowledge bases by numeric or otherwise predictable identifiers. It becomes risky when the application accepts a caller-supplied identifier through GET /api/knowledgebases/{id} or the knowledgebaseId parameter of POST /api/models/chat without consistently checking whether the requesting user is authorized to access the referenced resource.

Exploit preconditions

  • Attack surface: Network-accessible ChatOllama knowledge-base API endpoints
  • Required access: Ability to send requests to the affected API; authentication requirements depend on deployment configuration
  • Trigger point: Supplying a knowledge-base identifier in the path or request parameter
  • Why exploitation is possible: Identifiers may be predictable or sequential, while object-level authorization does not adequately bind the requested resource to the requesting user
  • Attack surface: Network-accessible ChatOllama knowledge-base API endpoints
  • Required access: Ability to send requests to the affected API; authentication requirements depend on deployment configuration
  • Trigger point: Supplying a knowledge-base identifier in the path or request parameter
  • Why exploitation is possible: Identifiers may be predictable or sequential, while object-level authorization does not adequately bind the requested resource to the requesting user

Why this happens

The underlying flaw is an object-level authorization failure. The application uses a client-provided knowledge-base identifier to retrieve a resource but does not reliably verify that the caller owns or is permitted to access that resource.

This behavior maps to CWE-639: Authorization Bypass Through User-Controlled Key, commonly known as an insecure direct object reference. Predictable identifiers increase the risk because attackers can test references associated with other users.

The underlying flaw is an object-level authorization failure. The application uses a client-provided knowledge-base identifier to retrieve a resource but does not reliably verify that the caller owns or is permitted to access that resource.

This behavior maps to CWE-639: Authorization Bypass Through User-Controlled Key, commonly known as an insecure direct object reference. Predictable identifiers increase the risk because attackers can test references associated with other users.

Potential impact

  • Attackers may read private knowledge-base metadata
  • Retrieved document content could be disclosed
  • Confidential business or personal information may be exposed
  • Unauthorized users could map resource identifiers and tenant activity
  • Downstream applications may process or reveal compromised knowledge-base data
  • Attackers may read private knowledge-base metadata
  • Retrieved document content could be disclosed
  • Confidential business or personal information may be exposed
  • Unauthorized users could map resource identifiers and tenant activity
  • Downstream applications may process or reveal compromised knowledge-base data

General mitigation guidance

Mitigation typically focuses on enforcing object-level authorization at every resource access point.

Common defensive patterns include:

  • Verify ownership or explicit access rights for every requested knowledge base
  • Derive the caller identity from a trusted session or token rather than request data
  • Use authorization checks consistently across direct retrieval and chat-related code paths
  • Prefer opaque, non-sequential identifiers as defense in depth, without treating them as authorization
  • Return indistinguishable responses for unauthorized and nonexistent resources where appropriate
  • Apply least-privilege access controls and tenant isolation around stored documents
  • Limit response data to the minimum required by the caller

Mitigation typically focuses on enforcing object-level authorization at every resource access point.

Common defensive patterns include:

  • Verify ownership or explicit access rights for every requested knowledge base
  • Derive the caller identity from a trusted session or token rather than request data
  • Use authorization checks consistently across direct retrieval and chat-related code paths
  • Prefer opaque, non-sequential identifiers as defense in depth, without treating them as authorization
  • Return indistinguishable responses for unauthorized and nonexistent resources where appropriate
  • Apply least-privilege access controls and tenant isolation around stored documents
  • Limit response data to the minimum required by the caller

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis and code review of handlers that use request identifiers in database or storage lookups
  • Review signals such as missing ownership predicates, authorization checks performed after retrieval, or shared lookup helpers without caller context
  • API tests that request resources belonging to different users and verify consistent denial
  • Monitoring for sequential or high-volume identifier enumeration across knowledge-base endpoints
  • Policy enforcement requiring object-level authorization tests for every resource-oriented API
  • Automated security review tools that identify user-controlled keys used without authorization constraints

Organizations can look for this weakness through:

  • Static analysis and code review of handlers that use request identifiers in database or storage lookups
  • Review signals such as missing ownership predicates, authorization checks performed after retrieval, or shared lookup helpers without caller context
  • API tests that request resources belonging to different users and verify consistent denial
  • Monitoring for sequential or high-volume identifier enumeration across knowledge-base endpoints
  • Policy enforcement requiring object-level authorization tests for every resource-oriented API
  • Automated security review tools that identify user-controlled keys used without authorization constraints

Sources

SourceLink
github.comgithub.com/sugarforever/chat-ollama/blob/6f4245a96b58ce8833a8c51d90d923b0e9814784/server/api/knowledgebases/%5Bid%5D.get.ts#L25-L34
github.comgithub.com/sugarforever/chat-ollama/blob/6f4245a96b58ce8833a8c51d90d923b0e9814784/server/api/models/chat/index.post.ts#L392-L427
hackmd.iohackmd.io/@hieuPenguinnn/chat-ollama-knowledge-base-cross-user-idor
vulncheck.comvulncheck.com/advisories/chatollama-through-commit-96c3ce5-idor-exposes-private-knowledge-bases

Frequently asked

questions

Yes, it may be exploitable remotely when the affected API is reachable and accepts attacker-controlled knowledge-base identifiers without effective object-level authorization.

Not necessarily. The exact requirement depends on the deployment's authentication controls, but any authenticated user with access to the endpoints may be able to target resources belonging to other users if ownership checks are missing.

Authorize every knowledge-base access against the authenticated caller's identity and permissions before returning metadata or document content. Do not rely on identifier secrecy or unpredictability as the primary control.

Add cross-user access tests, enforce centralized authorization policies, use least-privilege tenant isolation, and monitor for identifier enumeration and unusual cross-resource access patterns.

Yes, it may be exploitable remotely when the affected API is reachable and accepts attacker-controlled knowledge-base identifiers without effective object-level authorization.

Not necessarily. The exact requirement depends on the deployment's authentication controls, but any authenticated user with access to the endpoints may be able to target resources belonging to other users if ownership checks are missing.

Authorize every knowledge-base access against the authenticated caller's identity and permissions before returning metadata or document content. Do not rely on identifier secrecy or unpredictability as the primary control.

Add cross-user access tests, enforce centralized authorization policies, use least-privilege tenant isolation, and monitor for identifier enumeration and unusual cross-resource access patterns.

Find out what's already
exploitable in your codebase.