CVE-2026-31231 Code injection in n/a

Critical 9.8 Published Updated

Attackers can execute arbitrary Python code on Cognee servers via the notebook API due to unsafe exec() usage, leading to full system compromise.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2026-31231?

CVE-2026-31231 is a critical code injection vulnerability in n/a, published on 12 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-94

Which versions are affected by CVE-2026-31231?

How do I fix CVE-2026-31231?

No fix has been published for CVE-2026-31231 yet. Limit exposure of the affected software until one is available.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-31231 being exploited?

There is no known exploitation of CVE-2026-31231 in the wild and no public exploit code.

Sources

Also known as GHSA-fcch-9ph8-q3p4.

Is CVE-2026-31231 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free