CVE-2026-31231 — Unauthenticated remote code execution via Cognee notebook cell execution API

MITRE service request: 1988584

Status: RESERVED (pending a qualifying public reference per CNA Rules §5.3).

Official CVE description

Cognee thru v0.4.0 contains a critical remote code execution vulnerability in its notebook cell execution API endpoint. The endpoint is designed to execute arbitrary Python code provided by the user, but it does so using the unsafe exec() function without any sandboxing, validation, or security controls. An attacker can exploit this by sending a specially crafted POST request containing malicious Python code to the execution endpoint. This leads to arbitrary code execution on the Cognee server with the privileges of the server process, allowing complete compromise of the system.

Summary

Exposed notebook execution endpoints accept arbitrary Python lists and run them with exec on the server. When backend access control or authentication is disabled (as described in coordinated testing), any remote client can obtain a root-equivalent shell on the API host.

Affected product and versions

Technical details

Risk

Critical on any internet-facing Cognee deployment lacking strong auth.

Remediation / workaround