kotaemon check_connection Insecure Deserialization RCE
First seen Aug 5, 2026 · Updated Aug 5, 2026 · CVSS 9.8
kotaemon, an open-source RAG (retrieval-augmented generation) UI and document QA toolkit through version 0.12.0, contains a critical unauthenticated insecure deserialization vulnerability in its check_connection endpoint. Attackers can supply crafted YAML/JSON payloads with a manipulated __type__ field to instantiate arbitrary Python classes, ultimately achieving remote code execution via subprocess.check_output injection.
Technical Analysis
The vulnerability stems from unsafe object instantiation logic in the check_connection endpoint, which trusts a client-supplied __type__ field to dynamically resolve and instantiate Python classes without authentication or input validation. By overriding __type__ to reference subprocess.check_output and supplying attacker-controlled arguments, an unauthenticated attacker can achieve arbitrary command execution with the privileges of the kotaemon application process (CVE-2026-69098, CVSS 9.8). This is a classic Python deserialization/type-confusion flaw similar in class to unsafe yaml.load or pickle-based RCEs, but exposed via a network-facing API endpoint with no authentication barrier. Because kotaemon is deployed as a RAG and document-QA framework often wired directly into LLM agent pipelines, tool chains, and vector store backends, successful exploitation grants attackers a foothold on hosts that frequently hold API keys, embedding model credentials, vector DB connection strings, and other agent infrastructure secrets. This directly impacts AI agent systems: any organization running kotaemon as a RAG backend for agentic workflows risks full host compromise, credential theft, and pivoting into connected LLM tool-use environments.
Affected Systems
kotaemon versions through 0.12.0; self-hosted deployments exposing the check_connection API endpoint, including instances integrated into RAG pipelines, document QA agents, and LLM tool-use frameworks.
Indicators of Compromise
- Endpoint: /check_connection (or equivalent API path exposing connection-check functionality)
- Payload pattern: JSON/YAML body containing "__type__": "subprocess.check_output"
- Anomalous outbound subprocess execution from kotaemon application process
- Unexpected child processes spawned by the kotaemon Python runtime
Remediation Steps
- 1
Upgrade kotaemon
Update to a patched version of kotaemon beyond 0.12.0 once available; monitor the project's GitHub advisories for a fix.
- 2
Restrict endpoint exposure
Do not expose the check_connection endpoint (or the entire kotaemon API) to untrusted networks; place it behind authentication, a VPN, or an allowlisted reverse proxy.
- 3
Input validation and sandboxing
If patching is not immediately possible, apply a WAF rule or reverse-proxy filter to block requests containing __type__ fields referencing subprocess or os modules.
- 4
Least-privilege process execution
Run the kotaemon application under a low-privilege service account and containerize with restricted filesystem and network access to limit blast radius of RCE.
- 5
Rotate and isolate agent credentials
Rotate any API keys, embedding service credentials, and vector store secrets accessible from the kotaemon host, and store them in a secrets manager rather than local config files.
- 6
Monitor for exploitation
Deploy EDR/host monitoring to detect anomalous subprocess spawning from the kotaemon process and alert on unexpected outbound connections.
CVE / Advisory IDs
Industries Most Exposed
Respond to this threat
Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.