CVE-2026-141341: Coconut through 3.3.0 Code Execution via Jupyter Kernel Module Hijacking
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.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Users of Coconut through 3.3.0 are exposed when they open a notebook from a directory containing an attacker-planted coconut package. The code runs under the privileges of the user who opens the notebook and whose Coconut Jupyter kernel starts.
What does an attacker need to exploit it?
The attacker needs to place a malicious coconut/__init__.py beside the target notebook. User interaction is required: the target must open the notebook so that the Coconut kernel auto-starts.
Are users affected merely by having Coconut installed?
No. The described execution path depends on opening a notebook located in a directory where a malicious coconut package has been placed.
How can I check for potential compromise?
Inspect directories containing notebooks opened with the Coconut kernel for an unexpected coconut/__init__.py or other untrusted coconut package content placed alongside the notebook. Treat such files as potentially executed when the notebook was opened.