Extensions bypass allow_binary_download
One of the things that I wanted to change when forking this editor was to stop it from taking actions without explicit permission, like connecting and downloading stuff off the internet or running binaries on the system (or installing NPM packages). As part of doing that my initial solution was to move all of the language server support that I relied on into the editor itself and to implement the allow_binary_download flag which already existed but was unimplemented in the code base.
The consequence of the first part of all that was that I myself don't really use extensions, and haven't really focused much on the extension system. It's a huge mess right now especially around the installation which requires a full rust toolchain for Wasm and WASI, but I got it kind of working well enough I thought and I have some vague ideas around replacing it with interpreted code using Roto.
Turns out the extensions bypass the entire language server installation path and just downloads and installs whatever they want. (See this bug report).
There is a permission system in the config that supposedly could block extensions from installing anything:
// The capabilities granted to extensions.
//
// This list can be customized to restrict what extensions are able to do.
"granted_extension_capabilities": [
{ "kind": "process:exec", "command": "*", "args": ["**"] },
{ "kind": "download_file", "host": "*", "path": ["**"] },
{ "kind": "npm:install", "package": "*" },
],
...but as you can see, the default is to allow everything, and from a quick dig through the code I am pretty sure it doesn't really work anyway.
So yeah, this is a notice to any Gram users as of version 3.3.0: Be aware that if you install an extension, it can do pretty much whatever it wants. That includes downloading and installing language servers, running them, stealing all your bitcoins and eating all your biscuits.