Opening a repo in Neovim or Helix runs its code
Fake job interviews hide malware in take-home repos. Open one Rust, Ruby or TypeScript file in Neovim or Helix, and its language server runs the repo's code without asking.
- Published
- Reading time
- 5 min
- Tags
- Share
- Subscribe
- Other formats
A recruiter’s got a job for you that pays a bit too well, and the next step is a take-home: clone this repo, fix a bug, send it back. You’ve read about the fake interviews where the repo is the malware, so you’re not running npm install, and you’re not opening it in VS Code either, since the ones Trend Micro wrote up in April started their malware from a task that VS Code runs as soon as you trust the folder. You’ll just have a read in Neovim first. There’s no task runner in there, so what could it possibly run?
The language server, as it happens, and whatever it decides to run.
I made four tiny repos, in Rust, Ruby, TypeScript and Go, each with one file that writes a marker to disk if anything ever runs it. Then I opened one source file from each in a container with the network off, and didn’t touch a key for a minute. Neovim had nvim-lspconfig set up the way its README says, with one vim.lsp.enable line naming the four servers. Helix needs no setup, and its master branch has a new workspace trust feature, so I tried that as well as the last release, 25.07.1 from July 2025.
Run on 30 November 2026, on a fresh copy of each repo every time. Every yes had written its marker
within 15 seconds of the file opening, most within two. The last row is Helix master with its
trust level set to "none".
| Editor | Rust | Ruby | TypeScript | Go |
|---|---|---|---|---|
| Neovim 0.12.6 | Yes | Yes | Yes | No |
| Helix 25.07.1 | Yes | Yes | Yes | No |
| Helix master | Yes | Yes | Yes | No |
| Helix, none | No | No | No | No |
What actually runs
In Rust, it’s build.rs. rust-analyzer builds your project so it can understand it, and on a fresh clone that means running the build script and any proc macros, on purpose. Its security page starts with “At the moment, rust-analyzer assumes that all code is trusted”, and lists a few more ways in, like a rust-toolchain.toml that swaps rustc for any program you like. Mine was just this:
fn main() {
let msg = format!("build.rs ran at {:?}\n", std::time::SystemTime::now());
let _ = std::fs::write("/out/canary-buildrs", msg);
}In Ruby, it’s the Gemfile, which is a Ruby script with a fancy name. If there’s a Gemfile.lock next to it, ruby-lsp writes its own Gemfile into .ruby-lsp/ that pulls yours in with eval_gemfile, then hands that to Bundler, all before the server proper has started. Ruby LSP’s security page is upfront about it: “Execute any code in your Gemfile (Gemfiles are Ruby code)”.
In TypeScript, it’s tsserver.js. typescript-language-server doesn’t understand TypeScript itself. It starts TypeScript’s own tsserver and talks to that, and it prefers the repo’s copy over the one it brought with it. So the one-line tsserver.js I’d put in the repo’s node_modules/typescript/lib ran instead. VS Code finds the same file, but won’t use it till you say yes, and Yarn’s docs say that’s for safety.
Neovim has a second way in for JavaScript and TypeScript, too. lspconfig’s ts_ls, eslint and a dozen-odd other configs start the server itself from the repo’s own node_modules/.bin if there’s one there. That’s lspconfig #4576, open since 15 November, where a Neovim maintainer suggests dropping the lookup or putting it behind :trust. My TypeScript repo had no node_modules/.bin, so its ticks are the tsserver.js swap on its own.
Go stayed quiet. gopls started up and loaded the package, but Go has no build scripts, and the Go team treats a module that makes go build run code as a security bug to be fixed. That’s not quite the same as never, since the cgo flag allowlist that went in to stop it has been bypassed six times. But nothing in Go does it by design.
Helix’s new trust doesn’t ask
Helix’s master branch (not in a release yet) can ask you to trust each new workspace, and the prompt is pretty clear about why:
Trusted workspaces may load local Helix config files (
.helix/*) and auto-start language servers. Both can execute arbitrary code.
The default trust level is "servers", though, which lets language servers start in every workspace anyway. The reasoning’s in the source: “the binaries are global (PATH-resolved, user-installed), so auto-launching them in a fresh workspace matches expectations.” Which is true of the binary. The trouble is what it runs next, like that build.rs, which came with the repo.
With servers already allowed, the prompt is only there to ask about a repo’s .helix/ config, and a repo without one never sees it. Here’s the whole screen a few seconds after hx src/main.rs, with no prompt and no warning, and build.rs had already written its marker by then:
1 fn main() { println!("hi"); }
~
NOR src/main.rs 1 sel 1:1
Set the level to "none" and you get the prompt instead, with a [⚠] in the corner. I left it unanswered for a minute in each of the four repos, and nothing ran.
VS Code and Zed wait too, for what that’s worth. VS Code’s Restricted Mode keeps rust-analyzer and Ruby LSP off, because each extension’s manifest says it can’t run in an untrusted folder (rust-analyzer’s own reason is “A malicious actor could exploit this to run arbitrary code on your machine”), and its built-in TypeScript sticks to the copy it ships with. Zed’s docs say its restricted mode won’t install or start language servers until you trust the folder, bar global ones like Prettier. But that only lasts till you click Trust, and a take-home you’re meant to build and run is going to ask you to.
Reading one without running it
The proper answer is a throwaway VM or container with nothing in it you’d miss. If you just want a look in your own editor first, turn the language servers off. I checked each of these against the same four repos, and nothing ran.
In Neovim, --clean skips your config and plugins, so lspconfig never loads:
nvim --clean src/main.rs
Helix 25.07.1 has no trust at all. It’ll take a config file with the servers switched off in place of yours, but a repo’s own .helix/config.toml still goes on top. I gave mine one that switched them back on, and build.rs ran eight seconds in. So bin that folder first:
[editor.lsp]
enable = falserm -rf .helix
hx -c ~/.config/helix/no-lsp.toml src/main.rs
Helix’s master branch holds a repo’s .helix/ back until you trust it, so there you only need this in your normal config, and every new workspace waits for a yes:
[editor.workspace-trust]
level = "none"