Skip to main content

Coconut EUVDEUVD-2026-140309

| CVE-2026-141341 HIGH
Uncontrolled Search Path Element (CWE-427)
2026-12-01 VulnCheck GHSA-46vx-4v63-rm72
8.5
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Ship repo/archive with malicious notebook
  2. Delivery
    Plant coconut/__init__.py beside notebook
  3. Exploit
    Victim opens notebook in Jupyter
  4. Execution
    Kernel auto-starts, sys.path[0] loads shadow package
  5. Impact
    Arbitrary code executes as the user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V13 - Configuration Search path element control
Exploitation Conditions

Exploitation requires that the victim has the Coconut Jupyter kernel installed (pip install coconut, which ships share/jupyter/kernels/coconut/kernel.json, or a kernel installed via coconut --jupyter) and that the victim opens an attacker-controlled notebook whose metadata.kernelspec.name selects the 'coconut' kernel from a directory that also contains a planted coconut/__init__.py. The trigger is opening the notebook itself (the POST /api/sessions that JupyterLab, Notebook 7, or VS Code sends), which starts the kernel with cwd set to the notebook's directory; no cell needs to be executed. The kernelspec argv uses -m coconut.icoconut with no -P (Python 3.11+) or -I, so sys.path[0] is the notebook directory and the shadow package wins. Limiting factors: the coconut kernel must be present on the victim's machine, user interaction is mandatory (the victim must open an untrusted notebook), only versions <= 3.3.0 are affected (fixed in 3.3.1), and code runs with the opening user's privileges (on JupyterHub, the hub user).

Impact

This is a genuine, actionable code-execution flaw rather than an inflated high-CVSS score, but its real-world urgency is moderated by a required user action and a limited install base. The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H, 8.5) and the GHSA-provided 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, 8.8) agree on the core picture: no privileges or authentication are needed (PR:N), complexity is low, and the technical impact is total (SSVC Technical Impact: total; full C/I/A compromise), but exploitation requires the victim to open an attacker-supplied notebook (UI:P / UI:R). The two vectors disagree on attack vector - the official 4.0 uses AV:L (consistent with opening a file from a cloned repo or extracted archive on the local system) while the GHSA 3.1 uses AV:N; AV:L is the more defensible reading because the trigger is a local notebook file, not a network service. SSVC rates Automatable: no, which fits - each victim must individually open a malicious notebook, so this favors targeted or opportunistic social-engineering delivery (malicious repos, course bundles, archives) over worm-like mass exploitation. There is no CISA KEV listing and no EPSS score in the provided data, so widespread active exploitation is not evidenced; the SSVC exploitation status is 'poc' and the GHSA advisory publishes a complete working proof-of-concept. The vendor-priority Decision label is this_week, which should drive patching cadence - meaningful but not emergency. Net: a real priority for anyone with the coconut Jupyter kernel installed, tempered by the required user interaction and the product's niche footprint.

Exploit ScenarioDerived

An attacker publishes a repository, course bundle, or archive containing a notebook whose metadata selects the 'coconut' kernel, plus a coconut/__init__.py file placed in the same directory. A developer who has the Coconut Jupyter kernel installed clones or extracts it and opens the notebook in JupyterLab, Notebook 7, or VS Code; because python -m coconut.icoconut runs with the notebook's directory first on sys.path, the planted coconut package is imported and executes as that user before any cell is run. A full working proof-of-concept is published in the GHSA advisory (SSVC exploitation status: poc); it is not listed in CISA KEV.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Dec 02, 2026

Code execution in the Coconut package (PyPI) through 3.3.0 occurs when a victim opens an attacker-supplied Jupyter notebook that selects the bundled 'coconut' kernelspec from a folder that also contains a planted coconut/__init__.py, causing the attacker's package to be imported instead of the installed one before any cell is run. Exploitation requires the coconut kernel to be installed on the victim's machine and the victim to open the notebook (user interaction, no privileges required per the CVSS vector PR:N), and the injected code runs with the opening user's privileges - on JupyterHub, as the hub user. A public proof-of-concept is documented in the vendor advisory and SSVC exploitation status is 'poc'; there is no CISA KEV entry, so active exploitation is not confirmed, and the vendor priority label is this_week with the fix landing in 3.3.1.

RemediationAI

Vendor-released patch: 3.3.1 (fixing commit https://github.com/evhub/coconut/commit/8a26f0db5c86f35abc8c9f452d02448d505c59ae, advisory https://github.com/evhub/coconut/security/advisories/GHSA-85q3-whq8-63qq). Upgrade with pip install --upgrade coconut>=3.3.1; because the vulnerable argv is persisted in the installed kernelspec, upgrading the package alone does not rewrite existing kernel definitions on disk - the fix ships code that updates outdated Coconut kernels in place during install_default_jupyter_kernels, so re-run coconut --jupyter (install) after the upgrade and confirm that share/jupyter/kernels/coconut/kernel.json (including any user-level copy, which takes precedence over the system one) no longer contains -m coconut.icoconut but the -c ... runpy.run_module(...) form. Until that is verified, treat the host as still vulnerable even after the pip upgrade. Compensating controls, all with trade-offs: do not open notebooks from cloned repositories, course bundles or extracted archives unless the project tree is reviewed for a stray coconut/ directory (this blocks the attack entirely but is a policy control that relies on user discipline); remove or disable the coconut kernelspec (delete the kernel directory or jupyter kernelspec remove coconut) so affected notebooks cannot select it - the side effect is that Coconut notebooks will not run until the kernel is reinstalled after patching; run Jupyter with a root directory that never contains untrusted project folders, or open untrusted notebooks with a kernel whose definition you control, at the cost of manual per-project setup. Note that after the fix the notebook directory is no longer on sys.path, so cells that relied on importing sibling modules must add the path explicitly inside the kernel.

Affected VersionsENISA

coconut 0 ≤3.3.0

Affected Packages

euvd coconut no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The flaw is CWE-427 (untrusted search path), chained into CWE-94 code injection through Python's module-resolution behavior. Coconut ships a Jupyter kernelspec whose argv is python -m coconut.icoconut -f {connection_file}; pip install coconut installs it as wheel data at share/jupyter/kernels/coconut/kernel.json, and coconut --jupyter writes the same argv via make_custom_kernel in coconut/util.py. JupyterLab, Notebook 7 and VS Code start a kernel through POST /api/sessions when a notebook is merely opened, with the working directory set to the notebook's directory (jupyter_client LocalProvisioner), and python -m places the current directory at sys.path[0]. Because the argv lacks -P (Python 3.11+) and -I and resolves the module by name rather than by path, a <notebook dir>/coconut/__init__.py shadows the installed package and is executed while resolving coconut.icoconut - which also breaks Jupyter's trust model that opening an untrusted notebook executes nothing until a cell runs. The upstream fix replaces -m in the kernel.json files (py, py2, py3) and in the custom-kernel generator with -c "import sys; sys.path[:1] == [''] and sys.path.pop(0); import runpy; runpy.run_module('coconut.icoconut', run_name='__main__', alter_sys=True)", and applies the same python_module_argv helper to the LSP worker, pyright and mypy subprocesses, plus logic to rewrite already-installed kernelspecs in place.

Know when Coconut gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.5 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.8 HIGH

Trigger is a locally opened notebook file so AV:L; no privileges needed (PR:N) but the victim must open an untrusted notebook (UI:R); code runs as the user with full C/I/A impact.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

Coconut through 3.3.0 contains an untrusted search path vulnerability in its Jupyter kernelspec that allows attackers to execute code by placing a malicious coconut package beside a notebook. Because python -m coconut.icoconut puts the notebook's directory first on sys.path, a planted coconut/__init__.py runs as the user when the notebook opens and the kernel auto-starts.

Technical POC Analysis

CWE-427 (Uncontrolled Search Path Element), with CWE-94 as the second tag.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

The Coconut package (PyPI) through version 3.3.0 contains a code execution vulnerability that allows an attacker to run malicious code with the privileges of a user who opens a crafted Jupyter notebook. This affects data scientists, analysts, and any employee using JupyterHub, potentially leading to unauthorized access to sensitive data and systems. Leadership should prioritize remediation because a publicly available proof-of-concept exists and the vendor has released a fix.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

Prevalence
Low
Coconut is a niche functional-programming-to-Python compiler with small deployment footprint
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org Vulnrichment GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Defer
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy