-
Notifications
You must be signed in to change notification settings - Fork 292
Loading Kernels from insecure directories
VS Code loads Jupyter Kernels located in a number different directories, as documented here.
One such directory where kernels are loaded from is %PROGRAMDATA%\jupyter
(on Windows).
Launching Kernels defined in such directories pose a security threat to the user as this directory does not require elevated permissions. Hence it is possible that the user could be launching a malicious Kernel from such location.
It is advised that users create kernels in other directories as defined here which do not have such relaxed permission, or create a folder %PROGRAMDATA%\jupyter\kernels\
and configure it to be writable only by the current user.
Optionally, users could continue to use such kernels by updating the setting jupyter.kernels.trusted
to include the path to such kernelspecs.
Updating the setting jupyter.kernels.trusted
:
- Copy the fully qualified path to the kernelspec, e.g.
C:\ProgramData\Jupyter\kernels\Python3\kernel.json
- Open the VS User Settings UI using the command
Preferences: Open User Settings
from theCommand Palette
. - Search for the setting
jupyter.kernels.trusted
- Add a new value into the list using the
Add
button - Re-load VS Code
At any point it is possible to remove the above kernel from the setting there by disallowing this kernel to run in VS Code.
- Contribution
- Source Code Organization
- Coding Standards
- Profiling
- Coding Guidelines
- Component Governance
- Writing tests
- Kernels
- Intellisense
- Debugging
- IPyWidgets
- Extensibility
- Module Dependencies
- Errors thrown
- Jupyter API
- Variable fetching
- Import / Export
- React Webviews: Variable Viewer, Data Viewer, and Plot Viewer
- FAQ
- Kernel Crashes
- Jupyter issues in the Python Interactive Window or Notebook Editor
- Finding the code that is causing high CPU load in production
- How to install extensions from VSIX when using Remote VS Code
- How to connect to a jupyter server for running code in vscode.dev
- Jupyter Kernels and the Jupyter Extension