CVE-2026-31231
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedCognee 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceCognee through v0.4.0 has a critical RCE vulnerability in its notebook cell execution API endpoint. The endpoint uses Python's unsafe exec() function to run arbitrary user-supplied code without any sandboxing, input validation, or security controls. Attackers can exploit this by sending malicious Python code via POST requests, achieving arbitrary code execution with server process privileges.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify if Cognee is installedRun 'pip show cognee' or check your package manager for the cognee package installationAffected if Cognee is not installed or cannot be found in your environment
-
Check installed Cognee versionRun 'pip show cognee' and note the Version field, or run 'pip list | grep cognee'Affected if The installed version is 0.4.0 or any version prior to 0.4.0
-
Verify the notebook cell execution API existsSearch the Cognee installation directory for files handling notebook cell execution - look for API route definitions containing 'notebook' or 'cell' in filenames or code patternsAffected if The notebook cell execution API endpoint is present in the codebase
-
Check for unsafe exec() usage in cell execution codeGrep the codebase for 'exec(' patterns within files related to notebook or cell execution, or inspect the cell execution handler code directlyAffected if The code uses exec() to execute user-supplied code without sandboxing
-
Determine if the notebook API is exposedReview your web server or API configuration to see if the notebook cell execution endpoint is exposed and accessible via networkAffected if The endpoint is accessible over the network without authentication or additional security controls
You are affected if Cognee version 0.4.0 or earlier is installed AND the notebook cell execution API endpoint is enabled with unsafe exec() usage in the code.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
From vendor dataDisable the vulnerable notebook cell execution API endpoint immediately. Replace the unsafe exec() with a properly sandboxed execution environment (e.g., isolated containers, restricted subprocess execution with allowlist validation) or implement strict input validation and code analysis before execution.
- Consultation6.0 h
- Implementation16.0 h
- Testing8.0 h
- Review / QA6.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $10,176.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-31231 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-31231 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data