/

CVE-2026-69098

Severity:

CRITICAL RISK

(9.8)

Unsafe Deserialization (CWE-502) in Kotaemon API Endpoint

CVE-2026-69098

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

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

Kotaemon through version 0.12.0 contains an unsafe deserialization vulnerability in the check_connection endpoint. An unauthenticated attacker may submit specially crafted YAML or JSON data that causes arbitrary Python classes to be instantiated, potentially resulting in remote code execution with the application's privileges.

Affected context

The vulnerability occurs in Kotaemon deployments that expose the check_connection endpoint and process attacker-controlled YAML or JSON input. Risk is greatest when the endpoint is reachable without authentication and the deserialization logic permits dynamic Python object or class resolution before enforcing strict type and schema controls.

Exploit preconditions

  • Attack surface: The Kotaemon check_connection endpoint
  • Required access: Network access to the endpoint; authentication may not be required
  • Trigger point: Processing of YAML or JSON request data containing dynamic type information
  • Why exploitation is possible: The endpoint permits attacker-controlled input to influence Python class instantiation, allowing deserialization to invoke functionality beyond the intended connection-checking behavior

Why this happens

The underlying bug is the use of a deserialization mechanism that treats type metadata from untrusted input as authoritative. Instead of restricting input to a known data schema and permitted value types, the application resolves attacker-influenced class references during parsing. This behavior maps to CWE-502: Deserialization of Untrusted Data because serialized input can cause unintended object construction and execution of privileged application functionality.

Potential impact

  • An attacker may execute arbitrary commands with the application process privileges.
  • The attacker could access, alter, or delete data available to the service.
  • Credentials, tokens, or configuration secrets in the process environment may be exposed.
  • The compromised service could be used for lateral movement or further application-layer attacks.
  • Availability may be affected through process disruption or resource consumption.

General mitigation guidance

Mitigation generally focuses on removing executable behavior from request deserialization and reducing trust in client-provided type information.

Common defensive patterns include:

  • Use safe, data-only parsers that do not resolve arbitrary Python classes or constructors.
  • Define an explicit allowlist of accepted fields, types, and operations for connection checks.
  • Reject dynamic type metadata unless it is required and independently validated against a narrow registry.
  • Validate input before invoking application logic and apply strict size, format, and value constraints.
  • Require authentication and authorization for administrative or diagnostic endpoints where feasible.
  • Run the service with least privilege and isolate its filesystem, network, and secret access.
  • Keep sensitive credentials out of the process environment and restrict outbound connectivity where practical.

How teams detect issues like this

High-level detection can include:

  • Static analysis rules for unsafe YAML or JSON deserialization and dynamic class resolution.
  • Code review checks for request fields that control imports, constructors, object types, or callable selection.
  • API tests that verify unknown fields and type metadata are rejected by schema validation.
  • Web application firewall or gateway policies restricting unexpected content types and suspicious diagnostic endpoint requests.
  • Runtime monitoring for unusual child-process creation, command execution, outbound connections, or access to sensitive files.
  • Automated security review tools can help identify deserialization APIs and missing authentication controls, but findings should be validated against the application's actual data flow.

Sources

SourceLink
github.comgithub.com/Cinnamon/kotaemon/issues/844
vulncheck.comvulncheck.com/advisories/kotaemon-unauthenticated-remote-code-execution-via-insecure-deserialization

Frequently asked

questions

Yes. When the check_connection endpoint is network-accessible without authentication, an attacker may be able to submit malicious serialized input remotely.

The described issue permits unauthenticated exploitation, although deployment-level access controls such as an API gateway or network restriction may limit exposure.

Replace dynamic deserialization with a data-only parser, enforce a strict schema, and reject attacker-controlled type or class references.

Treat serialized request data as untrusted, use explicit type allowlists, protect diagnostic endpoints with authentication and authorization, and apply least-privilege runtime controls.

Find out what's already
exploitable in your codebase.